From acbb66b896a35c762ef9ba9bef2759c7ac4eefcf Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Mon, 25 Feb 2013 17:37:22 +0000 Subject: [PATCH] add vhost-update playbook to help updating virthost boxes --- playbooks/vhost-update.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 playbooks/vhost-update.yml diff --git a/playbooks/vhost-update.yml b/playbooks/vhost-update.yml new file mode 100644 index 0000000000..20887e3ce3 --- /dev/null +++ b/playbooks/vhost-update.yml @@ -0,0 +1,39 @@ +# requires --extra-vars="vhost=somevhostname yumcommand=update" + +- name: find instances + hosts: $vhost + user: root + + tasks: + - name: get list of guests + action: virt command=list_vms + register: vmlist + + - name: add them to myvms_new group + local_action: add_host hostname=$item groupname=myvms_new + with_items: ${vmlist.list_vms} + +- name: update all run rkhunter if installed + hosts: $vhost;myvms_new + user: root + + tasks: + - name: expire-caches + action: command yum clean expire-cache + + - name: yum -y ${yumcommand} + action: command yum -y ${yumcommand} + + - name: check for rkhunter + action: command /usr/bin/test -f /usr/bin/rkhunter + register: rkhunter + ignore_errors: true + + - name: run rkhunter --propupd + action: command /usr/bin/rkhunter --propupd + only_if: "'${rkhunter.rc}' == '0'" + + + + +