Hello!
Let's say I have a simple dictionary in host_vars or group_vars:
host_presets:
hostname: "{{ inventory_hostname.split('.')[0] }}
domain: "{{ inventory_hostname| regex_replace('^' + inventory_hostname.
split('.')[0] + '\\.', '')}}"
It works perfectly till I try to get it for other host with
hostvars['myvm'].host_presets.hostname. In this case I get the hostname of
the server that runs a playbook.
Is there a working way for dynamic predefining this kind of host/group vars?
Regards,
Roman
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/388b2255-98dd-4bb4-abc0-4bf472d9d348%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.