mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Reverting the role default variables change
Loading the default variables in _build_role_dependencies() lead to a side-effect where those variables were over-riding inventory variables.
This commit is contained in:
parent
47a89a57fa
commit
266d2008d8
1 changed files with 0 additions and 12 deletions
|
@ -169,12 +169,6 @@ class Play(object):
|
||||||
vars_data = utils.parse_yaml_from_file(vars)
|
vars_data = utils.parse_yaml_from_file(vars)
|
||||||
if vars_data:
|
if vars_data:
|
||||||
role_vars = utils.combine_vars(vars_data, role_vars)
|
role_vars = utils.combine_vars(vars_data, role_vars)
|
||||||
defaults = self._resolve_main(utils.path_dwim(self.basedir, os.path.join(role_path, 'defaults')))
|
|
||||||
defs_data = {}
|
|
||||||
if os.path.isfile(defaults):
|
|
||||||
defs_data = utils.parse_yaml_from_file(defaults)
|
|
||||||
if defs_data:
|
|
||||||
role_vars = utils.combine_vars(defs_data, role_vars)
|
|
||||||
# the meta directory contains the yaml that should
|
# the meta directory contains the yaml that should
|
||||||
# hold the list of dependencies (if any)
|
# hold the list of dependencies (if any)
|
||||||
meta = self._resolve_main(utils.path_dwim(self.basedir, os.path.join(role_path, 'meta')))
|
meta = self._resolve_main(utils.path_dwim(self.basedir, os.path.join(role_path, 'meta')))
|
||||||
|
@ -202,12 +196,6 @@ class Play(object):
|
||||||
vars_data = utils.parse_yaml_from_file(vars)
|
vars_data = utils.parse_yaml_from_file(vars)
|
||||||
if vars_data:
|
if vars_data:
|
||||||
dep_vars = utils.combine_vars(vars_data, dep_vars)
|
dep_vars = utils.combine_vars(vars_data, dep_vars)
|
||||||
defaults = self._resolve_main(utils.path_dwim(self.basedir, os.path.join(dep_path, 'defaults')))
|
|
||||||
defs_data = {}
|
|
||||||
if os.path.isfile(defaults):
|
|
||||||
defs_data = utils.parse_yaml_from_file(defaults)
|
|
||||||
if defs_data:
|
|
||||||
dep_vars = utils.combine_vars(defs_data, dep_vars)
|
|
||||||
if 'role' in dep_vars:
|
if 'role' in dep_vars:
|
||||||
del dep_vars['role']
|
del dep_vars['role']
|
||||||
self._build_role_dependencies([dep], dep_stack, passed_vars=dep_vars, level=level+1)
|
self._build_role_dependencies([dep], dep_stack, passed_vars=dep_vars, level=level+1)
|
||||||
|
|
Loading…
Reference in a new issue