diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-25 02:51:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-25 02:51:09 +0000 |
commit | 0832b2cf4b69cd84a24139132ccbc4b1d38cef42 (patch) | |
tree | 4c8ab9c23dbf2aebe016922303390be7eca71df4 /bin | |
parent | Adding upstream version 2.16.5. (diff) | |
download | ansible-core-0832b2cf4b69cd84a24139132ccbc4b1d38cef42.tar.xz ansible-core-0832b2cf4b69cd84a24139132ccbc4b1d38cef42.zip |
Adding upstream version 2.16.6.upstream/2.16.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ansible-config | 8 | ||||
-rwxr-xr-x | bin/ansible-inventory | 22 |
2 files changed, 6 insertions, 24 deletions
diff --git a/bin/ansible-config b/bin/ansible-config index f394ef7..eac8a31 100755 --- a/bin/ansible-config +++ b/bin/ansible-config @@ -270,7 +270,7 @@ class ConfigCLI(CLI): if not settings[setting].get('description'): continue - default = settings[setting].get('default', '') + default = self.config.template_default(settings[setting].get('default', ''), get_constants()) if subkey == 'env': stype = settings[setting].get('type', '') if stype == 'boolean': @@ -352,7 +352,7 @@ class ConfigCLI(CLI): if entry['key'] not in seen[entry['section']]: seen[entry['section']].append(entry['key']) - default = opt.get('default', '') + default = self.config.template_default(opt.get('default', ''), get_constants()) if opt.get('type', '') == 'list' and not isinstance(default, string_types): # python lists are not valid ini ones default = ', '.join(default) @@ -414,14 +414,16 @@ class ConfigCLI(CLI): if context.CLIARGS['format'] == 'display': if isinstance(config[setting], Setting): # proceed normally + value = config[setting].value if config[setting].origin == 'default': color = 'green' + value = self.config.template_default(value, get_constants()) elif config[setting].origin == 'REQUIRED': # should include '_terms', '_input', etc color = 'red' else: color = 'yellow' - msg = "%s(%s) = %s" % (setting, config[setting].origin, config[setting].value) + msg = "%s(%s) = %s" % (setting, config[setting].origin, value) else: color = 'green' msg = "%s(%s) = %s" % (setting, 'default', config[setting].get('default')) diff --git a/bin/ansible-inventory b/bin/ansible-inventory index 3550079..02e5eb2 100755 --- a/bin/ansible-inventory +++ b/bin/ansible-inventory @@ -25,26 +25,6 @@ from ansible.vars.plugins import get_vars_from_inventory_sources, get_vars_from_ display = Display() -INTERNAL_VARS = frozenset(['ansible_diff_mode', - 'ansible_config_file', - 'ansible_facts', - 'ansible_forks', - 'ansible_inventory_sources', - 'ansible_limit', - 'ansible_playbook_python', - 'ansible_run_tags', - 'ansible_skip_tags', - 'ansible_verbosity', - 'ansible_version', - 'inventory_dir', - 'inventory_file', - 'inventory_hostname', - 'inventory_hostname_short', - 'groups', - 'group_names', - 'omit', - 'playbook_dir', ]) - class InventoryCLI(CLI): ''' used to display or dump the configured inventory as Ansible sees it ''' @@ -247,7 +227,7 @@ class InventoryCLI(CLI): @staticmethod def _remove_internal(dump): - for internal in INTERNAL_VARS: + for internal in C.INTERNAL_STATIC_VARS: if internal in dump: del dump[internal] |