- name: install bind9 apt: pkg=bind9 state=installed - name: deploy named.conf.local template: src=named.conf.local.j2 dest=/etc/bind/named.conf.local notify: - restart bind9 - name: deploy named.conf.options template: src=named.conf.options.j2 dest=/etc/bind/named.conf.options notify: - restart bind9 - name: create named.conf.ffnet template: src=named.conf.ffnet.j2 dest=/etc/bind/named.conf.ffnet notify: - restart bind9 - name: create named.conf.tld template: src=named.conf.tld.j2 dest=/etc/bind/named.conf.tld notify: - restart bind9 - name: create named.conf template: src=named.conf.j2 dest=/etc/bind/named.conf notify: - restart bind9 - name: create own db file for gateway servers and backbone servers template: src=db.servers.ffnet.j2 dest=/etc/bind/db.servers.ffnet notify: - restart bind9 - name: create own db file for services template: src=db.services.ffnet.j2 dest=/etc/bind/db.services.ffnet notify: - restart bind9 - name: create own db file for each domain template: src=db.tld-template.j2 dest=/etc/bind/db.{{item.key}} tags: debug with_dict: "{{domains}}" notify: - restart bind9 - name: create own db.servers. file for each domain template: src=db.servers.tld-template.j2 dest=/etc/bind/db.servers.{{item.key}} tags: debug with_dict: "{{domains}}" notify: - restart bind9 - name: create own db.services. file for each domain template: src=db.services.tld-template.j2 dest=/etc/bind/db.services.{{item.key}} tags: debug with_dict: "{{domains}}" notify: - restart bind9 - name: knotendns.sh kopieren template: src=knotendns.j2 dest=/etc/bind/knotendns.sh mode=0755 - name: Cronjob anlegen, der Skript ausführt cron: name: run-dns-skript job: /etc/bind/knotendns.sh day: '*' hour: '*' minute: '*/3' state: present user: root