From: Ralf Jung Date: Sun, 20 May 2018 20:50:08 +0000 (+0200) Subject: make unbound its own role X-Git-Url: https://git.ralfj.de/ansible.git/commitdiff_plain/ee0707947ed908dfcba302f36dacc330316382d8?ds=sidebyside make unbound its own role --- diff --git a/roles/email/handlers/main.yml b/roles/email/handlers/main.yml index b953a16..342976a 100644 --- a/roles/email/handlers/main.yml +++ b/roles/email/handlers/main.yml @@ -2,7 +2,5 @@ service: name=opendkim state=restarted enabled=yes - name: postfix service: name=postfix state=restarted enabled=yes -- name: unbound - service: name=unbound state=restarted enabled=yes - name: dovecot service: name=dovecot state=restarted enabled=yes diff --git a/roles/email/tasks/main.yml b/roles/email/tasks/main.yml index dbe8bb6..71d184c 100644 --- a/roles/email/tasks/main.yml +++ b/roles/email/tasks/main.yml @@ -1,6 +1,4 @@ # daemons -- import_tasks: unbound.yml - tags: unbound - import_tasks: opendkim.yml tags: opendkim when: postfix.opendkim is defined diff --git a/roles/email/files/unbound/dhclient.conf b/roles/unbound/files/dhclient.conf similarity index 100% rename from roles/email/files/unbound/dhclient.conf rename to roles/unbound/files/dhclient.conf diff --git a/roles/email/files/unbound/listen.conf b/roles/unbound/files/listen.conf similarity index 100% rename from roles/email/files/unbound/listen.conf rename to roles/unbound/files/listen.conf diff --git a/roles/email/files/unbound/unbound.service.override b/roles/unbound/files/unbound.service.override similarity index 100% rename from roles/email/files/unbound/unbound.service.override rename to roles/unbound/files/unbound.service.override diff --git a/roles/email/tasks/unbound.yml b/roles/unbound/tasks/main.yml similarity index 89% rename from roles/email/tasks/unbound.yml rename to roles/unbound/tasks/main.yml index 0fe643c..c53cecb 100644 --- a/roles/email/tasks/unbound.yml +++ b/roles/unbound/tasks/main.yml @@ -6,14 +6,14 @@ register: unbound_config copy: dest: /etc/unbound/unbound.conf.d/listen.conf - src: files/unbound/listen.conf + src: files/listen.conf - name: configure systemd (create dir) file: path=/etc/systemd/system/unbound.service.d state=directory - name: configure systemd (tweak unbound) register: unbound_systemd copy: dest: /etc/systemd/system/unbound.service.d/override.conf - src: files/unbound/unbound.service.override + src: files/unbound.service.override - name: reload systemd when: unbound_systemd.changed command: systemctl daemon-reload @@ -29,7 +29,7 @@ when: dhclient.stat.exists == True copy: dest: /etc/dhcp/dhclient.conf - src: files/unbound/dhclient.conf + src: files/dhclient.conf - name: configure system DNS copy: dest: /etc/resolv.conf diff --git a/site.yml b/site.yml index 32c2a20..74658bf 100644 --- a/site.yml +++ b/site.yml @@ -6,6 +6,12 @@ - base tags: base +- hosts: unbound + gather_facts: no + roles: + - unbound + tags: unbound + - hosts: letsencrypt gather_facts: no roles: