refactor(apt-get): Do separate apt-get update with max age

This commit is contained in:
hygienic-books 2022-06-09 15:21:09 +02:00
parent 897d5c0bc6
commit cbcadc52bf
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1 @@
apt_cache_max_age_second: '600'

View File

@ -1,6 +1,12 @@
- name: 'Upgrade the OS (apt-get dist-upgrade)' - name: 'Update apt cache if older than {{apt_cache_max_age_second}}s'
ansible.builtin.apt: ansible.builtin.apt:
update_cache: 'yes' update_cache: 'yes'
cache_valid_time: '{{ apt_cache_max_age_second }}'
- name: 'Upgrade the OS (apt-get dist-upgrade)'
ansible.builtin.apt:
upgrade: 'dist' upgrade: 'dist'