32 lines
681 B
YAML
32 lines
681 B
YAML
---
|
|
- name: apt dist-upgrade Debian based servers
|
|
hosts:
|
|
- pve01_debian
|
|
tasks:
|
|
- name: Update package lists
|
|
apt:
|
|
update_cache: yes
|
|
|
|
- name: Only run "update_cache=yes" if the last one is more than 3600 seconds ago
|
|
apt:
|
|
update_cache: yes
|
|
cache_valid_time: 3600
|
|
|
|
- name: Upgrade all Packages
|
|
apt:
|
|
upgrade: dist
|
|
|
|
- name: Pass options to dpkg on run
|
|
apt:
|
|
upgrade: dist
|
|
update_cache: yes
|
|
dpkg_options: 'force-confold,force-confdef'
|
|
|
|
- name: Autoremove unused packages
|
|
become: yes
|
|
command: apt -y autoremove
|
|
|
|
- name: Removes all packages from the package cache
|
|
become: yes
|
|
command: apt -y clean
|
|
... |