Fix for private_key overriding in synchronize module

This commit is contained in:
vishwas
2020-08-15 08:16:54 -04:00
parent 06efaeb108
commit 4b0b50439d
12 changed files with 1943 additions and 4 deletions

View File

@@ -333,10 +333,8 @@ class ActionModule(ActionBase):
user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user
# Private key handling
private_key = self._play_context.private_key_file
if private_key is not None:
_tmp_args['private_key'] = private_key
# Use the private_key parameter if passed else use context private_key_file
_tmp_args['private_key'] = _tmp_args.get('private_key', self._play_context.private_key_file)
# use the mode to define src and dest's url
if _tmp_args.get('mode', 'push') == 'pull':