fix: use deb822_repository for Docker APT repo (proper GPG handling)
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:
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)
|
||||
|
||||
Reference in New Issue
Block a user