etc_dnsmasq.conf.j2 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Dnsmasq configuration
  2. # {{ ansible_managed }}
  3. {% if dnsmasq_listen_address is defined %}
  4. listen-address={{ dnsmasq_listen_address }}
  5. {% endif %}
  6. {% if dnsmasq_interface is defined %}
  7. interface={{ dnsmasq_interface }}
  8. {% endif %}
  9. {% if dnsmasq_port is defined %}
  10. port={{ dnsmasq_port }}
  11. {% endif %}
  12. {% if dnsmasq_domain_needed %}
  13. domain-needed
  14. {% endif %}
  15. {% if dnsmasq_bogus_priv %}
  16. bogus-priv
  17. {% endif %}
  18. {% if dnsmasq_resolv_file is defined %}
  19. resolv-file={{ dnsmasq_resolv_file }}
  20. {% endif %}
  21. {% if dnsmasq_addn_hosts is defined %}
  22. addn-hosts={{ dnsmasq_addn_hosts }}
  23. {% endif %}
  24. {% if dnsmasq_expand_hosts %}
  25. expand-hosts
  26. {% endif %}
  27. {% if dnsmasq_domain is defined %}
  28. domain={{ dnsmasq_domain }}
  29. {% endif %}
  30. {% if dnsmasq_no_resolv is defined %}
  31. no-resolv
  32. {% endif %}
  33. {% if dnsmasq_upstream_servers is defined %}
  34. {% if dnsmasq_upstream_servers is iterable %}
  35. {% for host in dnsmasq_upstream_servers %}
  36. server={{ host }}
  37. {% endfor %}
  38. {% else %}
  39. server={{ dnsmasq_upstream_servers }}
  40. {% endif %}
  41. {% endif %}
  42. {% if dnsmasq_force_address is defined %}
  43. {% if dnsmasq_force_address is iterable %}
  44. {% for address in dnsmasq_force_address %}
  45. address={{ address }}
  46. {% endfor %}
  47. {% endif %}
  48. {% endif %}
  49. conf-dir=/etc/dnsmasq.d