make unbound its own role
authorRalf Jung <post@ralfj.de>
Sun, 20 May 2018 20:50:08 +0000 (22:50 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 20 May 2018 20:50:08 +0000 (22:50 +0200)
roles/email/handlers/main.yml
roles/email/tasks/main.yml
roles/unbound/files/dhclient.conf [moved from roles/email/files/unbound/dhclient.conf with 100% similarity]
roles/unbound/files/listen.conf [moved from roles/email/files/unbound/listen.conf with 100% similarity]
roles/unbound/files/unbound.service.override [moved from roles/email/files/unbound/unbound.service.override with 100% similarity]
roles/unbound/tasks/main.yml [moved from roles/email/tasks/unbound.yml with 89% similarity]
site.yml

index b953a16..342976a 100644 (file)
@@ -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
index dbe8bb6..71d184c 100644 (file)
@@ -1,6 +1,4 @@
 # daemons
-- import_tasks: unbound.yml
-  tags: unbound
 - import_tasks: opendkim.yml
   tags: opendkim
   when: postfix.opendkim is defined
similarity index 89%
rename from roles/email/tasks/unbound.yml
rename to roles/unbound/tasks/main.yml
index 0fe643c..c53cecb 100644 (file)
@@ -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
index 32c2a20..74658bf 100644 (file)
--- 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: