From 5e7d24235daeba32a534a1e85a28f76d7356fb3c Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Fri, 20 Dec 2013 21:47:29 +0000 Subject: [PATCH] Added host_update box --- playbooks/host_update.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 playbooks/host_update.yml diff --git a/playbooks/host_update.yml b/playbooks/host_update.yml new file mode 100644 index 0000000000..bcd21f9ea2 --- /dev/null +++ b/playbooks/host_update.yml @@ -0,0 +1,34 @@ +# This playbook updates hosts without guests. +# +# requires --extra-vars="target=somehostname yumcommand=update" + + +- name: update the system + hosts: "{{ target }}" + accelerate: true + gather_facts: false + user: root + + tasks: + - name: expire-caches + command: yum clean expire-cache + + - name: yum -y {{ yumcommand }} + command: yum -y {{ yumcommand }} + async: 7200 + poll: 30 + +- name: run rkhunter if installed + hosts: "{{ target }}" + accelerate: true + user: root + + tasks: + - name: check for rkhunter + command: /usr/bin/test -f /usr/bin/rkhunter + register: rkhunter + ignore_errors: true + + - name: run rkhunter --propupd + command: /usr/bin/rkhunter --propupd + when: rkhunter|success