This commit is contained in:
@@ -7,19 +7,22 @@
|
|||||||
ansible_sudo_pass: "${{ ANSIBLE_SUDO_PASS }}"
|
ansible_sudo_pass: "${{ ANSIBLE_SUDO_PASS }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Update all installed packages using APT module
|
- debug:
|
||||||
apt:
|
msg: "Pass: ${{ ANSIBLE_SUDO_PASS }}"
|
||||||
name: '*'
|
|
||||||
state: latest
|
- name: Update all installed packages using APT module
|
||||||
update_cache: yes
|
ansible.builtin.apt:
|
||||||
only_upgrade: yes
|
name: '*'
|
||||||
register: apt_update_status
|
state: latest
|
||||||
|
update_cache: yes
|
||||||
|
only_upgrade: yes
|
||||||
|
register: apt_update_status
|
||||||
|
|
||||||
- name: Remove packages not needed anymore
|
- name: Remove packages not needed anymore
|
||||||
apt:
|
ansible.builtin.apt:
|
||||||
autoremove: yes
|
autoremove: yes
|
||||||
|
|
||||||
- name: Reboot when packages were updated
|
- name: Reboot when packages were updated
|
||||||
reboot:
|
ansible.builtin.reboot:
|
||||||
post_reboot_delay: 60
|
post_reboot_delay: 60
|
||||||
when: apt_update_status.changed
|
when: apt_update_status.changed
|
||||||
Reference in New Issue
Block a user