Hello,
I am trying to generate hostlist.conf on munin machine based on inventory variables, i have something like this in template
hostlist.j2
`
{% for items in groups[‘all’] %}
[{{ hostvars[items][‘inventory_hostname_short’] }}.{{ hostvars[items][‘role_long’] }}.{{ domain }}]
address ssh://user@{{ hostvars[items][‘ansible_default_ipv4’][‘address’] }}:{{ hostvars[items][‘ansible_ssh_port’]|default(22) }} --spooldir /var/lib/munin-async/ --spoolfetch
use_node_name yes
load.load.warning :50
ntp_offset.offset.warning -1000:1000
ntp_offset.offset.critical -10000:10000
{% endfor %}
`
and test.yml which in turn calls hostlist.j2 template:
`