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)
|
- name: Add Docker APT repository (Debian/Ubuntu)
|
||||||
ansible.builtin.apt_repository:
|
community.general.deb822_repository:
|
||||||
repo: >-
|
name: docker
|
||||||
deb [arch={{ ansible_facts['architecture'] }} signed-by={{ docker_gpg_key_path }}]
|
types: deb
|
||||||
https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}
|
uris: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}"
|
||||||
{{ ansible_facts['distribution_release'] }} stable
|
suites: "{{ ansible_facts['distribution_release'] }}"
|
||||||
state: present
|
components: stable
|
||||||
update_cache: true
|
architectures: "{{ ansible_facts['architecture'] }}"
|
||||||
|
signed_by: "https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg"
|
||||||
when: ansible_facts['os_family'] == 'Debian'
|
when: ansible_facts['os_family'] == 'Debian'
|
||||||
|
|
||||||
- name: Install rootless Docker dependencies (Debian/Ubuntu)
|
- name: Install rootless Docker dependencies (Debian/Ubuntu)
|
||||||
|
|||||||
Reference in New Issue
Block a user