Added host_update box
This commit is contained in:
parent
e0fae8047a
commit
5e7d24235d
1 changed files with 34 additions and 0 deletions
34
playbooks/host_update.yml
Normal file
34
playbooks/host_update.yml
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue