summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu Saulnier <fantom@fedoraproject.org>2018-07-12 14:09:21 +0200
committerMatthieu Saulnier <fantom@fedoraproject.org>2018-07-12 14:09:21 +0200
commit442c134a5f4d47ce8b721b9ae4ddcb3c28737c78 (patch)
tree60e216148e8d1a78300c56df340b1c7049435389
parente4f638fe1a26e4e4439cdaaca5b4d05cfaacc93c (diff)
downloadplaybooks-ansible-442c134a5f4d47ce8b721b9ae4ddcb3c28737c78.tar.gz
playbooks-ansible-442c134a5f4d47ce8b721b9ae4ddcb3c28737c78.tar.xz
playbooks-ansible-442c134a5f4d47ce8b721b9ae4ddcb3c28737c78.zip
Move the update playbook into the main playbook
-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