refactor: adjust reboot check command and import role in yum_updates.yaml
This commit is contained in:
+5
-1
@@ -2,6 +2,10 @@
|
|||||||
- hosts: yumhosts
|
- hosts: yumhosts
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Import a role
|
||||||
|
ansible.builtin.import_role:
|
||||||
|
name: LucasJanin.ssh_config
|
||||||
|
|
||||||
- name: Update all installed packages using YUM module
|
- name: Update all installed packages using YUM module
|
||||||
ansible.builtin.yum:
|
ansible.builtin.yum:
|
||||||
use_backend: yum3
|
use_backend: yum3
|
||||||
@@ -25,7 +29,7 @@
|
|||||||
ansible.builtin.command: needs-restarting -r
|
ansible.builtin.command: needs-restarting -r
|
||||||
register: reboot_check
|
register: reboot_check
|
||||||
ignore_errors: yes # Important: The command returns a non-zero exit code if a reboot is needed
|
ignore_errors: yes # Important: The command returns a non-zero exit code if a reboot is needed
|
||||||
changed_when: false # This command does not change the system state
|
#changed_when: false # This command does not change the system state
|
||||||
|
|
||||||
- name: Reboot the server if required
|
- name: Reboot the server if required
|
||||||
ansible.builtin.reboot:
|
ansible.builtin.reboot:
|
||||||
|
|||||||
Reference in New Issue
Block a user