From b250e138d3d144a58439a51d68e0e0d2b2349553 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 9 Jan 2015 12:39:49 -0500 Subject: [PATCH] added environment to play and made both it and no_log inhertiable by task --- v2/ansible/executor/connection_info.py | 12 +++++++++++- v2/ansible/playbook/play.py | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/v2/ansible/executor/connection_info.py b/v2/ansible/executor/connection_info.py index 8f53c3fe34..7db96876e7 100644 --- a/v2/ansible/executor/connection_info.py +++ b/v2/ansible/executor/connection_info.py @@ -79,6 +79,10 @@ class ConnectionInformation: self.sudo_user = play.sudo_user self.sudo_pass = play.sudo_pass + # non connection related + self.no_log = play.no_log + self.environment = play.environment + def set_options(self, options): ''' Configures this connection information instance with data from @@ -124,6 +128,12 @@ class ConnectionInformation: self.sudo_user = ci.sudo_user self.sudo_pass = ci.sudo_pass self.verbosity = ci.verbosity + + # other + self.no_log = ci.no_log + self.environment = ci.environment + + # requested tags self.only_tags = ci.only_tags.copy() self.skip_tags = ci.skip_tags.copy() @@ -136,7 +146,7 @@ class ConnectionInformation: new_info = ConnectionInformation() new_info.copy(self) - for attr in ('connection', 'remote_user', 'su', 'su_user', 'su_pass', 'sudo', 'sudo_user', 'sudo_pass'): + for attr in ('connection', 'remote_user', 'su', 'su_user', 'su_pass', 'sudo', 'sudo_user', 'sudo_pass', 'environment', 'no_log'): if hasattr(task, attr): attr_val = getattr(task, attr) if attr_val: diff --git a/v2/ansible/playbook/play.py b/v2/ansible/playbook/play.py index 22d57dfa57..3de550b23c 100644 --- a/v2/ansible/playbook/play.py +++ b/v2/ansible/playbook/play.py @@ -80,6 +80,7 @@ class Play(Base, Taggable): # Flag/Setting Attributes _any_errors_fatal = FieldAttribute(isa='bool', default=False) + _environment = FieldAttribute(isa='dict', default=dict()) _max_fail_percentage = FieldAttribute(isa='string', default='0') _no_log = FieldAttribute(isa='bool', default=False) _serial = FieldAttribute(isa='int', default=0)