fix: use deb822_repository for Docker APT repo (proper GPG handling)
CI / quality (pull_request) Successful in 1m4s
CI / molecule-tests (0) (pull_request) Failing after 2m3s
CI / molecule-tests (1) (pull_request) Failing after 2m6s
CI / molecule-tests (2) (pull_request) Failing after 2m20s

The apt_repository module with signed-by wasn't working because the
downloaded GPG key wasn't properly dearmored. The deb822_repository
module handles GPG key download and dearmoring automatically.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Emil Simeonov
2026-06-20 21:35:19 +02:00
co-authored by Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent 2a803c611b
commit 8aa00c7091
@@ -1,19 +1,13 @@
---
- name: Install Docker GPG key (Debian/Ubuntu)
ansible.builtin.get_url:
url: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg"
dest: "{{ docker_gpg_key_path }}"
mode: "0644"
when: ansible_facts['os_family'] == 'Debian'
- name: Add Docker APT repository (Debian/Ubuntu)
ansible.builtin.apt_repository:
repo: >-
deb [arch={{ ansible_facts['architecture'] }} signed-by={{ docker_gpg_key_path }}]
https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}
{{ ansible_facts['distribution_release'] }} stable
state: present
update_cache: true
community.general.deb822_repository:
name: docker
types: deb
uris: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}"
suites: "{{ ansible_facts['distribution_release'] }}"
components: stable
architectures: "{{ ansible_facts['architecture'] }}"
signed_by: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg"
when: ansible_facts['os_family'] == 'Debian'
- name: Install rootless Docker dependencies (Debian/Ubuntu)