25 lines
535 B
YAML
25 lines
535 B
YAML
- name: 'Update apt cache if older than {{apt_cache_max_age_second}}s'
|
|
ansible.builtin.apt:
|
|
update_cache: 'yes'
|
|
cache_valid_time: '{{ apt_cache_max_age_second }}'
|
|
|
|
|
|
|
|
- name: 'Upgrade the OS (apt-get dist-upgrade)'
|
|
ansible.builtin.apt:
|
|
upgrade: 'dist'
|
|
force_apt_get: 'yes'
|
|
|
|
|
|
|
|
- name: 'Check if reboot required'
|
|
register: reboot_required_file
|
|
ansible.builtin.stat:
|
|
path: '/var/run/reboot-required'
|
|
|
|
|
|
|
|
- name: 'Reboot if required'
|
|
when: '(reboot_required_file.stat.exists == true)'
|
|
ansible.builtin.reboot:
|