mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 15:34:01 -07:00
Adds 'ansible_check_mode' boolean magic variable
* Makes it possible to pass any options variable to VariableManager by changing `load_options_vars(options)` in `lib/ansible/utils/vars.py`
This commit is contained in:
parent
1942cd33dc
commit
eed6cf5dad
7 changed files with 54 additions and 2 deletions
|
@ -111,6 +111,13 @@ def load_extra_vars(loader, options):
|
|||
extra_vars = combine_vars(extra_vars, data)
|
||||
return extra_vars
|
||||
|
||||
def load_options_vars(options):
|
||||
options_vars = {}
|
||||
# For now only return check mode, but we can easily return more
|
||||
# options if we need variables for them
|
||||
options_vars['ansible_check_mode'] = options.check
|
||||
return options_vars
|
||||
|
||||
def isidentifier(ident):
|
||||
"""
|
||||
Determines, if string is valid Python identifier using the ast module.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue