update-packages: lint
This commit is contained in:
parent
14a3745aa4
commit
0fc64bfd0a
1 changed files with 14 additions and 14 deletions
|
@ -1,34 +1,34 @@
|
||||||
---
|
---
|
||||||
- block:
|
- block:
|
||||||
|
|
||||||
- name: update packages (Fedora Atomic)
|
- name: Update packages (Fedora Atomic)
|
||||||
atomic_host:
|
community.general.atomic_host:
|
||||||
revision: latest
|
revision: latest
|
||||||
when: ansible_distribution == 'Fedora' and is_atomic
|
when: ansible_distribution == 'Fedora' and ansible_local.os.is_atomic
|
||||||
register: atomic_host_upgraded
|
register: atomic_host_upgraded
|
||||||
|
|
||||||
- name: refresh and update packages (Fedora)
|
- name: Refresh and update packages (DNF driven distros)
|
||||||
dnf:
|
ansible.builtin.dnf:
|
||||||
name: "*"
|
name: "*"
|
||||||
state: latest
|
state: latest
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
when: ansible_distribution == 'Fedora' and not is_atomic
|
when: ansible_distribution in ['CentOS', 'Fedora', 'Red Hat Enterprise Linux', 'RedHat'] and not ansible_local.os.is_atomic
|
||||||
register: fedora_upgraded
|
register: fedora_upgraded
|
||||||
|
|
||||||
- name: update packages (generic - non-atomic/dnf)
|
- name: Update packages (generic - non-atomic/dnf)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: '*'
|
name: '*'
|
||||||
state: latest
|
state: latest
|
||||||
when: ansible_distribution in ["CentOS", "Red Hat Enterprise Linux", "RedHat", "Debian", "Ubuntu"] and not is_atomic
|
when: ansible_distribution in ["Debian", "Ubuntu"]
|
||||||
register: host_upgraded
|
register: host_upgraded
|
||||||
|
|
||||||
- name: reboot updated hosts
|
- name: Reboot updated hosts
|
||||||
shell: nohup bash -c "sleep 2 && shutdown -r now" &
|
ansible.builtin.shell: nohup bash -c "sleep 2 && shutdown -r now" &
|
||||||
register: host_reset
|
register: host_reset
|
||||||
when: (atomic_host_upgraded is changed) or (host_upgraded is changed) or (fedora_upgraded is changed)
|
when: (atomic_host_upgraded is changed) or (host_upgraded is changed) or (fedora_upgraded is changed)
|
||||||
|
|
||||||
- name: wait for rebooted host to return
|
- name: Wait for rebooted host to return
|
||||||
wait_for_connection:
|
ansible.builtin.wait_for_connection:
|
||||||
timeout: 300
|
timeout: 300
|
||||||
delay: 20
|
delay: 20
|
||||||
when: host_reset is changed
|
when: host_reset is changed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue