25 lines
535 B
YAML
Raw Permalink Normal View History

- 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'
2022-06-09 15:22:23 +02:00
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)'
2022-06-09 15:22:49 +02:00
ansible.builtin.reboot: