initial commit
This commit is contained in:
commit
800836b2d9
23 changed files with 609 additions and 0 deletions
29
roles/update-packages/tasks/main.yml
Normal file
29
roles/update-packages/tasks/main.yml
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
- block:
|
||||
|
||||
- name: update packages (atomic)
|
||||
atomic_host:
|
||||
revision: latest
|
||||
when: ansible_distribution == 'Fedora' and is_atomic
|
||||
register: atomic_host_upgraded
|
||||
|
||||
- name: update packages (non-atomic)
|
||||
package:
|
||||
name: '*'
|
||||
state: latest
|
||||
when: ansible_distribution in ["CentOS", "Red Hat Enterprise Linux", "Fedora", "Debian", "Ubuntu"] and not is_atomic
|
||||
register: host_upgraded
|
||||
|
||||
- name: reboot updated hosts
|
||||
shell: nohup bash -c "sleep 2 && shutdown -r now" &
|
||||
register: host_reset
|
||||
when: (atomic_host_upgraded is changed) or (host_upgraded is changed)
|
||||
|
||||
- name: wait for rebooted host to return
|
||||
wait_for_connection:
|
||||
timeout: 300
|
||||
delay: 20
|
||||
when: host_reset is changed
|
||||
|
||||
tags:
|
||||
- update
|
Loading…
Add table
Add a link
Reference in a new issue