You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
765 B
41 lines
765 B
- name: update repository index
|
|
apt:
|
|
force_apt_get: yes
|
|
update_cache: yes
|
|
changed_when: no
|
|
|
|
|
|
- name: ensure apt-show-versions is installed
|
|
apt:
|
|
force_apt_get: yes
|
|
name: apt-show-versions
|
|
state: latest
|
|
|
|
|
|
- name: get upgradeable packages
|
|
shell:
|
|
cmd: apt-show-versions --upgradeable
|
|
register: upgradeable
|
|
changed_when: no
|
|
|
|
|
|
- block:
|
|
- name: pause and confirm updates
|
|
pause:
|
|
prompt: "{{ upgradeable.stdout }}"
|
|
|
|
|
|
- name: upgrade all packages
|
|
apt:
|
|
force_apt_get: yes
|
|
install_recommends: no
|
|
upgrade: dist
|
|
|
|
when: "(upgradeable.stdout_lines is defined) and (upgradeable.stdout_lines | length > 0)"
|
|
|
|
|
|
- name: clean repository cache
|
|
apt:
|
|
force_apt_get: yes
|
|
autoclean: yes
|
|
autoremove: yes
|
|
|