From bed7cd8b119c66453488d6cb205044b986696779 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 4 Oct 2017 15:09:26 -0400 Subject: [PATCH] restore connection options from cli fixes #30720 --- lib/ansible/playbook/play_context.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/playbook/play_context.py b/lib/ansible/playbook/play_context.py index becc18ec091..b95f5410cf1 100644 --- a/lib/ansible/playbook/play_context.py +++ b/lib/ansible/playbook/play_context.py @@ -174,6 +174,9 @@ RESET_VARS = ( 'ansible_ssh_executable', ) +OPTION_FLAGS = ('connection', 'remote_user', 'private_key_file', 'verbosity', 'force_handlers', 'step', 'start_at_task', 'diff', + 'ssh_common_args', 'docker_extra_args', 'sftp_extra_args', 'scp_extra_args', 'ssh_extra_args') + class PlayContext(Base): @@ -326,9 +329,8 @@ class PlayContext(Base): self.diff = boolean(options.diff, strict=False) # general flags (should we move out?) - # for flag in ('connection', 'remote_user', 'private_key_file', 'verbosity', 'force_handlers', 'step', 'start_at_task', 'diff'): # should only be 'non plugin' flags - for flag in ('connection', 'remote_user', 'private_key_file', 'verbosity', 'force_handlers', 'step', 'start_at_task', 'diff'): + for flag in OPTION_FLAGS: attribute = getattr(options, flag, False) if attribute: setattr(self, flag, attribute)