mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-12 19:06:39 +08:00
Added host_update box
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user