feat(redis): replace apt update task with command to ensure compatibility

This commit is contained in:
2026-08-09 00:33:03 +02:00
parent 80a4e33fc2
commit 05cb840e6d
+12 -17
View File
@@ -8,22 +8,6 @@
else '/etc/redis/redis.conf' else '/etc/redis/redis.conf'
}} }}
- name: (redis-server.yml) update
ansible.builtin.apt:
update_cache: true
cache_valid_time: >-
{{
0
if apt_config_updated is defined and apt_config_updated.changed
else apt_update_cache_valid_time
}}
changed_when: false
when:
- ansible_facts['distribution'] == "Debian"
- apt_update|bool
tags:
- redis-server
- name: >- - name: >-
(redis-server.yml) Configure any half-installed packages (redis-server.yml) Configure any half-installed packages
'dpkg --configure -a' 'dpkg --configure -a'
@@ -37,10 +21,21 @@
tags: tags:
- redis-server - redis-server
- name: (redis-server.yml) update
ansible.builtin.command: apt-get update # noqa: command-instead-of-module
changed_when: false
environment:
DEBIAN_FRONTEND: noninteractive
when:
- ansible_facts['distribution'] == "Debian"
- apt_update|bool
tags:
- redis-server
- name: (redis-server.yml) upgrade - name: (redis-server.yml) upgrade
ansible.builtin.apt: ansible.builtin.apt:
upgrade: "{{ apt_upgrade_type }}" upgrade: "{{ apt_upgrade_type }}"
# apt cache is refreshed in the preceding "update" task # apt cache refresh happens in the preceding redis update task
update_cache: false update_cache: false
dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}" dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}"
when: when: