From faa0561ffbd17c6bcd5f86a7c2ec4a417b64d132 Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Fri, 20 Dec 2013 00:46:24 +0000 Subject: [PATCH] Attempt to run the restart_unbound sequence on reboot if necessary. --- playbooks/restart_unbound.yml | 9 +-------- playbooks/vhost_reboot.yml | 9 +++++++++ tasks/restart_unbound.yml | 10 ++++++++++ 3 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 tasks/restart_unbound.yml diff --git a/playbooks/restart_unbound.yml b/playbooks/restart_unbound.yml index 475f76d63e..f99fd02fe9 100644 --- a/playbooks/restart_unbound.yml +++ b/playbooks/restart_unbound.yml @@ -10,11 +10,4 @@ user: root tasks: - - name: set selinux permissive - selinux: policy=targeted state=permissive - - - name: restart unbound - service: name=unbound state=restarted - - - name: set selinux back to enforcing - selinux: policy=targeted state=enforcing + - include: $tasks/restart_unbound.yml diff --git a/playbooks/vhost_reboot.yml b/playbooks/vhost_reboot.yml index ff978cc73e..fdb74d2c57 100644 --- a/playbooks/vhost_reboot.yml +++ b/playbooks/vhost_reboot.yml @@ -96,6 +96,15 @@ command: /root/fix-iptables.sh when: inventory_hostname_short.startswith('serverbeach') +- name: Fix unbound if necessary + # intersection - hosts that are in our dynamic group and also in unbound-dns + hosts: "myvms_new:&unbound-dns" + accelerate: true + user: root + + tasks: + - include: $tasks/restart_unbound.yml + # - name: get info on guests (postreboot) # virt: command=info # register: vminfo_post diff --git a/tasks/restart_unbound.yml b/tasks/restart_unbound.yml new file mode 100644 index 0000000000..caef730ae6 --- /dev/null +++ b/tasks/restart_unbound.yml @@ -0,0 +1,10 @@ +# Restart unbound after reboots. + +- name: set selinux permissive + selinux: policy=targeted state=permissive + +- name: restart unbound + service: name=unbound state=restarted + +- name: set selinux back to enforcing + selinux: policy=targeted state=enforcing