-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix templated ansible_ssh_common_args issues #956
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -475,12 +475,13 @@ def ansible_ssh_timeout(self): | |
) | ||
|
||
def ssh_args(self): | ||
local_vars = self._task_vars.get("hostvars", {}).get(self._inventory_name, {}) | ||
return [ | ||
mitogen.core.to_text(term) | ||
for s in ( | ||
C.config.get_config_value("ssh_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})), | ||
C.config.get_config_value("ssh_common_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})), | ||
C.config.get_config_value("ssh_extra_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})) | ||
C.config.get_config_value("ssh_args", plugin_type="connection", plugin_name="ssh", variables=local_vars), | ||
C.config.get_config_value("ssh_common_args", plugin_type="connection", plugin_name="ssh", variables=local_vars), | ||
C.config.get_config_value("ssh_extra_args", plugin_type="connection", plugin_name="ssh", variables=local_vars) | ||
) | ||
for term in ansible.utils.shlex.shlex_split(s or '') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to self: ... for term in ansible.utils.shlex.shlex_split(s or '')] probably behaves identically to ... for term in ansible.utils.shlex.shlex_split(s) if s] An experiment/test would confirm this. If true, then I think |
||
] | ||
|
@@ -707,12 +708,13 @@ def ansible_ssh_timeout(self): | |
) | ||
|
||
def ssh_args(self): | ||
local_vars = self._task_vars.get("hostvars", {}).get(self._inventory_name, {}) | ||
return [ | ||
mitogen.core.to_text(term) | ||
for s in ( | ||
C.config.get_config_value("ssh_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})), | ||
C.config.get_config_value("ssh_common_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})), | ||
C.config.get_config_value("ssh_extra_args", plugin_type="connection", plugin_name="ssh", variables=self._task_vars.get("vars", {})) | ||
C.config.get_config_value("ssh_args", plugin_type="connection", plugin_name="ssh", variables=local_vars), | ||
C.config.get_config_value("ssh_common_args", plugin_type="connection", plugin_name="ssh", variables=local_vars), | ||
C.config.get_config_value("ssh_extra_args", plugin_type="connection", plugin_name="ssh", variables=local_vars) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to self: before: variables=self._task_vars.get("vars", {})
after: variables=self._task_vars.get("hostvars", {}).get(self._inventory_name, {}) |
||
) | ||
for term in ansible.utils.shlex.shlex_split(s) | ||
if s | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: