1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Remove vars attribute from base

Fixes #11779
This commit is contained in:
James Cammarata 2015-07-29 09:45:08 -04:00
parent 132c14eb57
commit 71867f9480
5 changed files with 5 additions and 5 deletions

View file

@ -47,8 +47,7 @@ class Base:
_port = FieldAttribute(isa='int')
_remote_user = FieldAttribute(isa='string')
# vars and flags
_vars = FieldAttribute(isa='dict', default=dict())
# flags and misc. settings
_environment = FieldAttribute(isa='list', default=[])
_no_log = FieldAttribute(isa='bool', default=False)

View file

@ -62,7 +62,6 @@ class Block(Base, Become, Conditional, Taggable):
if self._task_include:
all_vars.update(self._task_include.get_vars())
all_vars.update(self.vars)
return all_vars
@staticmethod

View file

@ -64,6 +64,7 @@ class Play(Base, Taggable, Become):
_name = FieldAttribute(isa='string', default='')
# Variable Attributes
_vars = FieldAttribute(isa='dict', default=dict())
_vars_files = FieldAttribute(isa='list', default=[])
_vars_prompt = FieldAttribute(isa='list', default=[])
_vault_password = FieldAttribute(isa='string')

View file

@ -91,6 +91,7 @@ class Task(Base, Conditional, Taggable, Become):
self._block = block
self._role = role
self._task_include = task_include
self._vars = dict()
super(Task, self).__init__()
@ -193,7 +194,7 @@ class Task(Base, Conditional, Taggable, Become):
super(Task, self).post_validate(templar)
def get_vars(self):
all_vars = self.vars.copy()
all_vars = self._vars.copy()
if self._block:
all_vars.update(self._block.get_vars())
if self._task_include:

View file

@ -73,7 +73,7 @@ test_hash:
ANSIBLE_HASH_BEHAVIOUR=merge ansible-playbook test_hash.yml -i $(INVENTORY) $(CREDENTIALS_ARG) -v -e '{"test_hash":{"extra_args":"this is an extra arg"}}'
test_var_precedence:
ansible-playbook test_var_precedence.yml -i $(INVENTORY) $(CREDENTIALS_ARG) -v -e 'extra_var=extra_var' -e 'extra_var_override=extra_var_override'
ansible-playbook test_var_precedence.yml -i $(INVENTORY) $(CREDENTIALS_ARG) $(TEST_FLAGS) -v -e 'extra_var=extra_var' -e 'extra_var_override=extra_var_override'
test_vault:
ansible-playbook test_vault.yml -i $(INVENTORY) $(CREDENTIALS_ARG) -v $(TEST_FLAGS) --vault-password-file $(VAULT_PASSWORD_FILE) --list-tasks