Guest User

Untitled

a guest
Feb 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. dnsmasq:
  2. zones:
  3. domain_com:
  4. hosts:
  5. 1.1.1.1: host1
  6. 1.1.1.2: host2
  7. 1.1.1.3: host3
  8. 1.1.1.21: host21
  9.  
  10. {% for zone in pillar['dnsmasq']['zones'] %}
  11.  
  12. /tmp/{{ zone }}:
  13. file.managed:
  14. - contents:
  15. {% for ip, host in pillar['dnsmasq']['zones'][zone]['hosts']|dictsort %}
  16. {{ ip }} {{ host }}
  17. {% endfor %}
  18. {% endfor %}
  19.  
  20. # cat /tmp/domain_com
  21. 1.1.1.1 host1
  22. 1.1.1.2 host2
  23. 1.1.1.21 host21
  24. 1.1.1.3 host3
  25.  
  26. # cat /tmp/domain_com
  27. 1.1.1.1 host1
  28. 1.1.1.2 host2
  29. 1.1.1.3 host3
  30. 1.1.1.21 host21
Add Comment
Please, Sign In to add comment