X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=playbooks%2Fdebian%2Froles%2Fnamed%2Ftasks%2Fmain.yml;h=d3bf3da20a2c3058d87e6e188a3b1e6fb938c6ab;hb=e38070b8a91afe8092698c3408cde9c5691b54e4;hp=b39eda30ceead641e07f1cfd5da7bd4f9e0645cb;hpb=a1b08d5935de21449861924a509622a33325fcbf;p=ansible.git diff --git a/playbooks/debian/roles/named/tasks/main.yml b/playbooks/debian/roles/named/tasks/main.yml index b39eda3..d3bf3da 100644 --- a/playbooks/debian/roles/named/tasks/main.yml +++ b/playbooks/debian/roles/named/tasks/main.yml @@ -8,31 +8,39 @@ msg: "BIND has already been configured" when: named_conf.stdout not in ('', "0") -- name: Install BIND - become: true - apt: - autoclean: yes - autoremove: yes - install_recommends: no - name: bind9 - purge: yes - state: latest - update_cache: yes - when: named_conf.stdout in ('', "0") +- block: + - name: Install BIND + become: true + apt: + autoclean: yes + autoremove: yes + install_recommends: no + name: bind9 + purge: yes + state: latest + update_cache: yes -- name: Configure BIND - become: true - copy: - src: named.conf.options - dest: /etc/bind/named.conf.options - owner: bind - group: bind - mode: '0600' - when: named_conf.stdout in ('', "0") + - name: Configure BIND + become: true + copy: + src: named.conf.options + dest: /etc/bind/named.conf.options + owner: bind + group: bind + mode: '0600' -- name: Reload BIND - become: true - service: - name: bind9 - state: reloaded + - name: Reload BIND + become: true + service: + name: bind9 + state: reloaded + + - name: Configure resolver + become: true + copy: + content: "nameserver 127.0.0.1" + dest: /etc/resolv.conf + owner: root + group: root + mode: '0644' when: named_conf.stdout in ('', "0")