๐Ÿ“— Ansible playbooks and roles for building an idempotent, interconnected and scalable infrastructure
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.
ansible-playbooks/roles/common/tasks/debian.yml

54 lines
985 B

2 years ago
- name: set timezone
community.general.timezone:
name: "{{ timezone }}"
notify: restart crond
when: timezone is defined
- name: flush handlers
meta: flush_handlers
- name: update repository index
apt:
force_apt_get: yes
update_cache: yes
2 years ago
changed_when: no
2 years ago
- 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
2 years ago
changed_when: no
2 years ago
- block:
- name: pause and confirm updates
pause:
prompt: "{{ upgradeable.stdout }}"
2 years ago
when: interactive | d(true) == true
2 years ago
- 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