Fix up for new syntax and make faster.

This commit is contained in:
Kevin Fenzi 2013-11-21 21:37:43 +00:00
parent fd8d810fda
commit 04498829a1

View file

@ -1,43 +1,43 @@
# This playboook updates a virthost and all it's guests.
#
# requires --extra-vars="target=somevhostname yumcommand=update" # requires --extra-vars="target=somevhostname yumcommand=update"
#
- name: find instances - name: find instances
hosts: $target hosts: "{{ target }}"
accelerate: true accelerate: true
gather_facts: False
user: root user: root
tasks: tasks:
- name: get list of guests - name: get list of guests
action: virt command=list_vms virt: command=list_vms
register: vmlist register: vmlist
- name: add them to myvms_new group - name: add them to myvms_new group
local_action: add_host hostname=$item groupname=myvms_new local_action: add_host hostname={{ item }} groupname=myvms_new
with_items: ${vmlist.list_vms} with_items: vmlist.list_vms
- name: update all run rkhunter if installed - name: update all run rkhunter if installed
hosts: $target;myvms_new hosts: "{{ target }}:myvms_new"
accelerate: true accelerate: true
gather_facts: False
user: root user: root
tasks: tasks:
- name: expire-caches - name: expire-caches
action: command yum clean expire-cache command: yum clean expire-cache
- name: yum -y ${yumcommand} - name: yum -y {{ yumcommand }}
action: command yum -y ${yumcommand} command: yum -y {{ yumcommand }}
async: 7200 async: 7200
poll: 50 poll: 30
- name: check for rkhunter - name: check for rkhunter
action: command /usr/bin/test -f /usr/bin/rkhunter command: /usr/bin/test -f /usr/bin/rkhunter
register: rkhunter register: rkhunter
ignore_errors: true ignore_errors: true
- name: run rkhunter --propupd - name: run rkhunter --propupd
action: command /usr/bin/rkhunter --propupd command: /usr/bin/rkhunter --propupd
when: rkhunter|success when: rkhunter|success