aboutsummaryrefslogblamecommitdiffstats
path: root/roles/space_server/tasks/named.yml
blob: ac9571f69a78428b1ae42e23c06ef289e552e31e (plain) (tree)
1
2
3
4
5
6
7
8
   
                     
           

                             


                





















                                            


                 
                       
           
                           
                      




                 






















                                                                
                          
                                         
              


                            

                            




                                
---
- name: Create s zone
  template:
    dest: '/etc/named/s.zone'
    src: s.zone.j2
    owner: root
    group: named
    mode: 0644
  notify:
  - restart named

- name: Create dhcp zone
  template:
    dest: '/var/named/dynamic/dhcp.zone'
    src: dhcp.zone.j2
    owner: named
    group: named
    mode: 0644
    force: no
  notify:
  - restart named

- name: Create ipv4 reverse dns zone
  template:
    dest: '/var/named/dynamic/ipv4.rev.zone'
    src: ipv4.rev.zone.j2
    owner: named
    group: named
    mode: 0644
    force: no
  notify:
  - restart named

- name: Configure named
  template:
    dest: '/etc/named.conf'
    src: named.conf.j2
    owner: root
    group: named
    mode: 0640
  notify:
  - restart named

- name: Create service drop-in directory
  file:
    dest: '/etc/systemd/system/named.service.d'
    state: directory
    owner: root
    group: root
    mode: 0755
- name: Start named after networks are configured
  copy:
    dest: '/etc/systemd/system/named.service.d/wait-online.conf'
    src: wait-online.conf
    owner: root
    group: root
    mode: 0644

- name: Enable named service
  systemd:
    name: named.service
    enabled: yes
    masked: no
    state: started
  when: not chroot
- name: '- when in chroot'
  command: systemctl enable named.service
  when: chroot

- name: Use our own resolver
  copy:
    dest: '/etc/resolv.conf'
    src: resolv.conf
    owner: root
    group: root
    mode: 0644

# vim: set ts=2 sw=2 et ft=yaml: