Add autoremove and reboot
All checks were successful
Ansible Deploy / deploy (push) Successful in 54s
All checks were successful
Ansible Deploy / deploy (push) Successful in 54s
This commit is contained in:
@@ -1,18 +1,25 @@
|
|||||||
---
|
---
|
||||||
- name: Update all packages (Debian)
|
- hosts: takahe
|
||||||
hosts: takahe
|
gather_facts: yes
|
||||||
become: yes
|
become: yes
|
||||||
vars:
|
vars:
|
||||||
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
|
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
|
||||||
ansible_sudo_pass: "{{ ANSIBLE_SUDO_PASS }}"
|
ansible_sudo_pass: "{{ ANSIBLE_SUDO_PASS }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Update package cache
|
- name: Update all installed packages using APT module
|
||||||
apt:
|
apt:
|
||||||
update_cache: yes
|
name: '*'
|
||||||
|
state: latest
|
||||||
|
update_cache: yes
|
||||||
|
only_upgrade: yes
|
||||||
|
register: apt_update_status
|
||||||
|
|
||||||
- name: Upgrade all packages
|
- name: Remove packages not needed anymore
|
||||||
apt:
|
apt:
|
||||||
upgrade: yes
|
autoremove: yes
|
||||||
autoremove: yes
|
|
||||||
autoclean: yes
|
- name: Reboot when packages were updated
|
||||||
|
reboot:
|
||||||
|
post_reboot_delay: 60
|
||||||
|
when: apt_update_status.changed
|
||||||
Reference in New Issue
Block a user