mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 15:41:22 -07:00
Allow role variables to be optionally kept in a private scope
This commit is contained in:
parent
a155f65a89
commit
b6c52ce115
3 changed files with 10 additions and 2 deletions
|
@ -197,8 +197,10 @@ class VariableManager:
|
|||
# whether or not vars files errors should be fatal at this
|
||||
# stage, or just base it on whether a host was specified?
|
||||
pass
|
||||
for role in play.get_roles():
|
||||
all_vars = self._combine_vars(all_vars, role.get_vars())
|
||||
|
||||
if not C.DEFAULT_PRIVATE_ROLE_VARS:
|
||||
for role in play.get_roles():
|
||||
all_vars = self._combine_vars(all_vars, role.get_vars())
|
||||
|
||||
if host:
|
||||
all_vars = self._combine_vars(all_vars, self._vars_cache.get(host.get_name(), dict()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue