2013-03-04 22:37:13 +00:00
|
|
|
# requires --extra-vars="target=somevhostname yumcommand=update"
|
2013-02-25 17:37:22 +00:00
|
|
|
|
|
|
|
- name: find instances
|
2013-11-22 22:03:52 +00:00
|
|
|
hosts: "{{ target }}"
|
2013-09-30 18:15:41 +00:00
|
|
|
accelerate: true
|
2013-02-25 17:37:22 +00:00
|
|
|
user: root
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- name: get list of guests
|
|
|
|
action: virt command=list_vms
|
|
|
|
register: vmlist
|
|
|
|
|
|
|
|
- name: add them to myvms_new group
|
2013-11-22 22:03:52 +00:00
|
|
|
local_action: add_host hostname={{ item }} groupname=myvms_new
|
|
|
|
with_items: vmlist.list_vms
|
2013-02-25 17:37:22 +00:00
|
|
|
|
2013-11-22 22:03:52 +00:00
|
|
|
- name: add the host to myvms_new group
|
|
|
|
local_action: add_host hostname={{ target }} groupname=myvms_new
|
|
|
|
|
|
|
|
- name: update the system
|
|
|
|
hosts: myvms_new
|
2013-09-30 18:15:41 +00:00
|
|
|
accelerate: true
|
2013-02-25 17:37:22 +00:00
|
|
|
user: root
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
- name: expire-caches
|
|
|
|
action: command yum clean expire-cache
|
|
|
|
|
2013-11-22 22:03:52 +00:00
|
|
|
- name: yum -y {{ yumcommand }}
|
|
|
|
action: command yum -y {{ yumcommand }}
|
2013-02-26 22:56:11 +00:00
|
|
|
async: 7200
|
2013-02-27 21:58:17 +00:00
|
|
|
poll: 50
|
2013-02-25 17:37:22 +00:00
|
|
|
|
2013-11-22 22:03:52 +00:00
|
|
|
- name: update all run rkhunter if installed
|
|
|
|
hosts: myvms_new
|
|
|
|
accelerate: true
|
|
|
|
user: root
|
|
|
|
|
|
|
|
tasks:
|
2013-02-25 17:37:22 +00:00
|
|
|
- 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
|
2013-07-05 17:15:37 +00:00
|
|
|
when: rkhunter|success
|
2013-02-25 17:37:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|