From 442c134a5f4d47ce8b721b9ae4ddcb3c28737c78 Mon Sep 17 00:00:00 2001 From: Matthieu Saulnier Date: Thu, 12 Jul 2018 14:09:21 +0200 Subject: Move the update playbook into the main playbook --- playbooks/update.yml | 13 ------------- site.yml | 2 +- update.yml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 14 deletions(-) delete mode 100644 playbooks/update.yml create mode 100644 update.yml diff --git a/playbooks/update.yml b/playbooks/update.yml deleted file mode 100644 index 7298766..0000000 --- a/playbooks/update.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- hosts: - - update - remote_user: root - tasks: - - name: Mise à jour système avec yum - yum: name=* state=latest - when: ansible_pkg_mgr == "yum" - - - name: Mise à jour système avec dnf - dnf: name=* state=latest - when: ansible_pkg_mgr == "dnf" - diff --git a/site.yml b/site.yml index 20c442b..204631c 100644 --- a/site.yml +++ b/site.yml @@ -10,4 +10,4 @@ - include: clients.yml - include: dnsserver.yml - include: torrelay.yml - +- include: update.yml diff --git a/update.yml b/update.yml new file mode 100644 index 0000000..9fe6b01 --- /dev/null +++ b/update.yml @@ -0,0 +1,30 @@ +--- +- hosts: + - update + remote_user: root + tasks: + - name: Mise à jour système avec yum + at: + command: /usr/bin/yum -y update + count: 5 + units: minutes + unique: yes + when: ansible_pkg_mgr == "yum" + notify: reboot auto + + - name: Mise à jour système avec dnf + at: + command: /usr/bin/dnf -y update + count: 5 + units: minutes + unique: yes + when: ansible_pkg_mgr == "dnf" + notify: reboot auto + + handlers: + - name: reboot auto + at: + command: /usr/sbin/reboot + count: 1 + units: hours + unique: yes -- cgit