Ansible - Ubuntu, update, upgrade, dist-upgrade, autoremove
vi apt_update.yml
---
- hosts: all
become: yes
tasks:
- name: update
apt:
update_cache=yes force_apt_get=yes cache_valid_time=3600
- name: upgrade
apt: upgrade=dist force_apt_get=y
- name: dist-upgrade
ansible.builtin.apt:
upgrade: dist
update_cache: yes
- name: autoremove
ansible.builtin.apt:
autoremove: yes
ansible-playbook -K apt_update.yml