From 3b795796bd03488a385f3ad42b10b8c0d61282c1 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Sun, 19 Nov 2017 01:19:10 +0100 Subject: space_server: unbound: use unbound instad of bind --- roles/space_server/tasks/main.yml | 4 +-- roles/space_server/tasks/named.yml | 52 ------------------------------------ roles/space_server/tasks/unbound.yml | 36 +++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 54 deletions(-) delete mode 100644 roles/space_server/tasks/named.yml create mode 100644 roles/space_server/tasks/unbound.yml (limited to 'roles/space_server/tasks') diff --git a/roles/space_server/tasks/main.yml b/roles/space_server/tasks/main.yml index 6893cbb..bd65b52 100644 --- a/roles/space_server/tasks/main.yml +++ b/roles/space_server/tasks/main.yml @@ -35,8 +35,8 @@ - import_tasks: radius.yml tags: radius when: radius_passwords is defined -- import_tasks: named.yml - tags: named +- import_tasks: unbound.yml + tags: unbound - import_tasks: avahi.yml tags: avahi diff --git a/roles/space_server/tasks/named.yml b/roles/space_server/tasks/named.yml deleted file mode 100644 index d295058..0000000 --- a/roles/space_server/tasks/named.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -- name: Install bind package - dnf: - name: bind - state: latest - notify: - - restart named - tags: - - packages - -- name: Configure named - copy: - src: named/named.conf - dest: '/etc/named.conf' - mode: 0640 - notify: - - restart named -- name: Create s zone - copy: - src: named/s.zone - dest: '/etc/named/s.zone' - notify: - - restart named - -- name: Create service drop-in directory - file: - dest: '/etc/systemd/system/named.service.d' - state: directory -- name: Start named after networks are configured - copy: - src: wait-online.conf - dest: '/etc/systemd/system/named.service.d/wait-online.conf' - -- name: Enable named service - systemd: - name: named.service - enabled: yes - masked: no - state: started - when: "'container' not in ansible_env" -- name: '- when in nspawn' - command: systemctl enable named.service - args: - creates: '/etc/systemd/system/multi-user.target.wants/named.service' - when: "'container' in ansible_env" - -- name: Use our own resolver - copy: - dest: /etc/resolv.conf - content: "nameserver 127.0.0.1\nnameserver ::1\n" - -# vim: set ts=2 sw=2 et ft=yaml: diff --git a/roles/space_server/tasks/unbound.yml b/roles/space_server/tasks/unbound.yml new file mode 100644 index 0000000..42db916 --- /dev/null +++ b/roles/space_server/tasks/unbound.yml @@ -0,0 +1,36 @@ +--- +- name: Install unbound package + dnf: + name: unbound + state: latest + notify: + - restart unbound + tags: + - packages + +- name: Configure unbound + copy: + src: unbound/unbound.conf + dest: '/etc/unbound/unbound.conf' + notify: + - restart unbound + +- name: Enable unbound service + systemd: + name: unbound.service + enabled: yes + masked: no + state: started + when: "'container' not in ansible_env" +- name: '- when in nspawn' + command: systemctl enable unbound.service + args: + creates: '/etc/systemd/system/multi-user.target.wants/unbound.service' + when: "'container' in ansible_env" + +- name: Use our own resolver + copy: + dest: /etc/resolv.conf + content: "nameserver 127.0.0.1\nnameserver ::1\n" + +# vim: set ts=2 sw=2 et ft=yaml: -- cgit v1.2.1