show internal but not hidden config options, while still hiding test options (#84997)

(cherry picked from commit aab732cb82)
pull/85101/head
Brian Coca 7 months ago committed by Matt Martz
parent 867d9d3096
commit ea22e5d0dd
No known key found for this signature in database
GPG Key ID: 40832D88E9FC91D8

@ -0,0 +1,2 @@
minor_changes:
- ansible-config will now show internal, but not test configuration entries. This allows for debugging but still denoting the configurations as internal use only (_ prefix).

@ -480,9 +480,9 @@ class ConfigManager(object):
else:
ret = self._plugins.get(plugin_type, {}).get(name, {})
if ignore_private:
if ignore_private: # ignore 'test' config entries, they should not change runtime behaviors
for cdef in list(ret.keys()):
if cdef.startswith('_'):
if cdef.startswith('_Z_'):
del ret[cdef]
return ret

@ -141,3 +141,17 @@
when:
- item[1] in gs[item[0]]
loop: '{{gs_keys | product(gs_all) }}'
- name: test ansible-config init for valid private and no hidden
vars:
config_keys: "{{ config_dump['stdout'] | from_json | selectattr('name', 'defined') }}"
block:
- name: run config full dump
shell: ansible-config dump -t all -f json
register: config_dump
- name: validate we get 'internal' but not hidden (_Z_)
assert:
that:
- config_keys | selectattr('name', 'match', '_.*') | length > 0
- config_keys | selectattr('name', 'match', '_Z_.*') | length == 0

Loading…
Cancel
Save