summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--playbooks/update.yml13
-rw-r--r--site.yml2
-rw-r--r--update.yml30
3 files changed, 31 insertions, 14 deletions
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