From 84fe6655d109396c629b1219c58b7bbc681c8155 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 28 Apr 2015 13:26:05 -0500 Subject: [PATCH] Fixing option order in connection info (v2) --- v2/ansible/executor/connection_info.py | 7 ++----- v2/samples/test_sudo.yml | 7 +++++++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 v2/samples/test_sudo.yml diff --git a/v2/ansible/executor/connection_info.py b/v2/ansible/executor/connection_info.py index 05fd5e8784c..7c9c9892ba5 100644 --- a/v2/ansible/executor/connection_info.py +++ b/v2/ansible/executor/connection_info.py @@ -65,14 +65,13 @@ class ConnectionInformation: self.no_log = False self.check_mode = False - if play: - self.set_play(play) - #TODO: just pull options setup to above? # set options before play to allow play to override them if options: self.set_options(options) + if play: + self.set_play(play) def __repr__(self): value = "CONNECTION INFO:\n" @@ -136,8 +135,6 @@ class ConnectionInformation: if options.check: self.check_mode = boolean(options.check) - - # get the tag info from options, converting a comma-separated list # of values into a proper list if need be. We check to see if the # options have the attribute, as it is not always added via the CLI diff --git a/v2/samples/test_sudo.yml b/v2/samples/test_sudo.yml new file mode 100644 index 00000000000..b8f7e168d07 --- /dev/null +++ b/v2/samples/test_sudo.yml @@ -0,0 +1,7 @@ +- hosts: ubuntu1404 + gather_facts: no + remote_user: testing + tasks: + - command: whoami + - apt: update_cache=yes + sudo: yes