main.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. - name: install bind9
  2. apt: pkg=bind9 state=installed
  3. - name: deploy named.conf.local
  4. template: src=named.conf.local.j2 dest=/etc/bind/named.conf.local
  5. notify:
  6. - restart bind9
  7. - name: deploy named.conf.options
  8. template: src=named.conf.options.j2 dest=/etc/bind/named.conf.options
  9. notify:
  10. - restart bind9
  11. - name: create named.conf.ffnet
  12. template: src=named.conf.ffnet.j2 dest=/etc/bind/named.conf.ffnet
  13. notify:
  14. - restart bind9
  15. - name: create named.conf.tld
  16. template: src=named.conf.tld.j2 dest=/etc/bind/named.conf.tld
  17. notify:
  18. - restart bind9
  19. - name: create named.conf
  20. template: src=named.conf.j2 dest=/etc/bind/named.conf
  21. notify:
  22. - restart bind9
  23. - name: create own db file for gateway servers and backbone servers
  24. template: src=db.servers.ffnet.j2 dest=/etc/bind/db.servers.ffnet
  25. notify:
  26. - restart bind9
  27. - name: create own db file for services
  28. template: src=db.services.ffnet.j2 dest=/etc/bind/db.services.ffnet
  29. notify:
  30. - restart bind9
  31. - name: create own db file for each domain
  32. template: src=db.tld-template.j2 dest=/etc/bind/db.{{item.key}}
  33. tags: debug
  34. with_dict: "{{domains}}"
  35. notify:
  36. - restart bind9
  37. - name: create own db.servers. file for each domain
  38. template: src=db.servers.tld-template.j2 dest=/etc/bind/db.servers.{{item.key}}
  39. tags: debug
  40. with_dict: "{{domains}}"
  41. notify:
  42. - restart bind9
  43. - name: create own db.services. file for each domain
  44. template: src=db.services.tld-template.j2 dest=/etc/bind/db.services.{{item.key}}
  45. tags: debug
  46. with_dict: "{{domains}}"
  47. notify:
  48. - restart bind9
  49. - name: knotendns.sh kopieren
  50. template: src=knotendns.j2 dest=/etc/bind/knotendns.sh mode=0755
  51. - name: Cronjob anlegen, der Skript ausführt
  52. cron:
  53. name: run-dns-skript
  54. job: /etc/bind/knotendns.sh
  55. day: '*'
  56. hour: '*'
  57. minute: '*/3'
  58. state: present
  59. user: root