# Generate hostlist.conf for Munin

**URL:** <https://forum.ansible.com/t/generate-hostlist-conf-for-munin/16358>\
**Category:** Ansible Project\
**Created:** [September 26, 2014, 11:52am UTC](https://forum.ansible.com/t/generate-hostlist-conf-for-munin/16358 "2014-09-26T11:52:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sibin\_Arsenijevic](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@Sibin\_Arsenijevic](https://forum.ansible.com/u/Sibin_Arsenijevic)\
**Post date:** [September 26, 2014, 11:52am UTC](https://forum.ansible.com/t/generate-hostlist-conf-for-munin/16358/1 "2014-09-26T11:52:13Z")

</div>

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:

`

---

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [November 11, 2014, 7:57pm UTC](https://forum.ansible.com/t/generate-hostlist-conf-for-munin/16358/2 "2014-11-11T19:57:48Z")

</div>

I think the problem could be caused by the delegate\_to  
Have you tried running the playbook without it? i.e. let the Munin master node to generate the conf file dynamically by being the one that connects to each Munin node to fill in the template.
