mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 06:30:19 -07:00
Only template each hostvars var on-demand (fixes #33259)
This commit is contained in:
parent
0f893027c4
commit
dae737c8b7
4 changed files with 40 additions and 12 deletions
|
@ -24,7 +24,7 @@ import yaml
|
|||
from ansible.module_utils.six import PY3
|
||||
from ansible.parsing.yaml.objects import AnsibleUnicode, AnsibleSequence, AnsibleMapping, AnsibleVaultEncryptedUnicode
|
||||
from ansible.utils.unsafe_proxy import AnsibleUnsafeText
|
||||
from ansible.vars.hostvars import HostVars
|
||||
from ansible.vars.hostvars import HostVars, HostVarsVars
|
||||
|
||||
|
||||
class AnsibleDumper(yaml.SafeDumper):
|
||||
|
@ -63,6 +63,11 @@ AnsibleDumper.add_representer(
|
|||
represent_hostvars,
|
||||
)
|
||||
|
||||
AnsibleDumper.add_representer(
|
||||
HostVarsVars,
|
||||
represent_hostvars,
|
||||
)
|
||||
|
||||
AnsibleDumper.add_representer(
|
||||
AnsibleSequence,
|
||||
yaml.representer.SafeRepresenter.represent_list,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue