feat: update apt upgrade tasks to conditionally refresh cache based on apt_update variable
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
- name: apt upgrade
|
||||
apt:
|
||||
upgrade: "{{ apt_upgrade_type }}"
|
||||
update_cache: true
|
||||
update_cache: "{{ not (apt_update | default(true) | bool) }}"
|
||||
dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}"
|
||||
when: apt_upgrade|bool
|
||||
tags:
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
- name: apt upgrade
|
||||
apt:
|
||||
upgrade: "{{ apt_upgrade_type }}"
|
||||
update_cache: true
|
||||
update_cache: "{{ not (apt_update | default(true) | bool) }}"
|
||||
dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}"
|
||||
when: apt_upgrade|bool
|
||||
tags:
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
- name: Upgrade packages
|
||||
ansible.builtin.apt:
|
||||
upgrade: "{{ apt_upgrade_type | default('safe') }}"
|
||||
update_cache: true
|
||||
update_cache: "{{ not (apt_update | default(true) | bool) }}"
|
||||
dpkg_options: "{{ (apt_upgrade_dpkg_options | default(['force-confdef','force-confold'])) | join(',') }}"
|
||||
when: (apt_upgrade | default(false)) | bool
|
||||
tags: [ansible-dependencies]
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
- name: apt upgrade
|
||||
apt:
|
||||
upgrade: "{{ apt_upgrade_type }}"
|
||||
update_cache: true
|
||||
update_cache: "{{ not (apt_update | default(true) | bool) }}"
|
||||
dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}"
|
||||
when: apt_upgrade|bool
|
||||
tags:
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
- name: apt upgrade
|
||||
apt:
|
||||
upgrade: "{{ apt_upgrade_type }}"
|
||||
update_cache: true
|
||||
update_cache: "{{ not (apt_update | default(true) | bool) }}"
|
||||
dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}"
|
||||
when: apt_upgrade|bool
|
||||
tags:
|
||||
|
||||
@@ -196,7 +196,9 @@
|
||||
- name: (apt.yml) apt upgrade
|
||||
ansible.builtin.apt:
|
||||
upgrade: "{{ apt_upgrade_type }}"
|
||||
update_cache: true
|
||||
# Cache refresh happens in the apt update task above.
|
||||
# Keep fallback refresh only if apt_update is disabled.
|
||||
update_cache: "{{ not (apt_update | bool) }}"
|
||||
dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}"
|
||||
when: apt_upgrade|bool
|
||||
tags:
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
- name: (caching-nameserver.yml) upgrade
|
||||
ansible.builtin.apt:
|
||||
upgrade: "{{ apt_upgrade_type }}"
|
||||
update_cache: true
|
||||
update_cache: "{{ not (apt_update | bool) }}"
|
||||
dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}"
|
||||
when:
|
||||
- ansible_facts["distribution"] == "Debian"
|
||||
|
||||
Reference in New Issue
Block a user