lotus-land-story: convert redis apt repository to deb822
Finishes the deb822 migration already applied to the shared playbooks.

Assisted-by: GLM-5.3 via pi
change qttkkyymzukzpyrxtrsxktkmrqzomxkq
commit 403be022196eedab11468b3766c0ce857f9476c7
author Alpha Chen <alpha@kejadlen.dev>
date
parent xzwqkxpl
diff --git a/lotus-land-story/redis.yml b/lotus-land-story/redis.yml
index d5b8350..8afcc9b 100644
--- a/lotus-land-story/redis.yml
+++ b/lotus-land-story/redis.yml
@@ -10,16 +10,35 @@
       args:
         creates: /usr/share/keyrings/redis-archive-keyring.gpg
 
+    # ansible.builtin.deb822_repository needs python-debian on the target.
+    - name: Install required packages
+      ansible.builtin.apt:
+        name: python3-debian
+        state: present
+        update_cache: true
+
+    # Left behind by ansible.builtin.apt_repository; apt reads both formats, so
+    # leaving it would configure the repository twice.
+    - name: Remove one-line Redis repository
+      ansible.builtin.file:
+        path: /etc/apt/sources.list.d/redis.list
+        state: absent
+
     - name: Add apt repo
-      ansible.builtin.apt_repository:
-        repo: "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb {{ ansible_facts.distribution_release }} main"
+      ansible.builtin.deb822_repository:
+        name: redis
+        types: deb
+        uris: https://packages.redis.io/deb
+        suites: "{{ ansible_facts.distribution_release }}"
+        components: main
+        signed_by: /usr/share/keyrings/redis-archive-keyring.gpg
         state: present
-        filename: redis
 
     - name: Install Redis
       ansible.builtin.apt:
         pkg: redis
         state: present
+        update_cache: true
 
     # TODO Figure out how to de-duplicate this
     - name: Save docker_ip