434 update apt key destination

This commit is contained in:
Omkar Kawade 2023-12-18 11:06:21 -08:00
parent 6cb849c416
commit 08ae86e0b5
2 changed files with 11 additions and 8 deletions

View File

@ -38,7 +38,7 @@ docker_apt_release_channel: stable
# and is only necessary until Docker officially supports them. # and is only necessary until Docker officially supports them.
docker_apt_ansible_distribution: "{{ 'ubuntu' if ansible_distribution in ['Pop!_OS', 'Linux Mint'] else ansible_distribution }}" docker_apt_ansible_distribution: "{{ 'ubuntu' if ansible_distribution in ['Pop!_OS', 'Linux Mint'] else ansible_distribution }}"
docker_apt_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}" docker_apt_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}"
docker_apt_repository: "deb [arch={{ docker_apt_arch }} signed-by=/etc/apt/keyrings/docker.gpg] {{ docker_repo_url }}/{{ docker_apt_ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" docker_apt_repository: "deb [arch={{ docker_apt_arch }} signed-by=/etc/apt/keyrings/docker.asc] {{ docker_repo_url }}/{{ docker_apt_ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}"
docker_apt_ignore_key_error: true docker_apt_ignore_key_error: true
docker_apt_gpg_key: "{{ docker_repo_url }}/{{ docker_apt_ansible_distribution | lower }}/gpg" docker_apt_gpg_key: "{{ docker_repo_url }}/{{ docker_apt_ansible_distribution | lower }}/gpg"
docker_apt_gpg_key_checksum: "sha256:1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570" docker_apt_gpg_key_checksum: "sha256:1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570"

View File

@ -33,13 +33,16 @@
state: directory state: directory
mode: '0755' mode: '0755'
- name: Ensure curl is present - name: Add Docker apt key.
package: name=curl state=present ansible.builtin.get_url:
url: "{{ docker_apt_gpg_key }}"
- name: Add Docker apt key dest: /etc/apt/keyrings/docker.asc
shell: > mode: '0644'
curl -fsSL {{ docker_apt_gpg_key }} | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg --yes force: false
changed_when: false checksum: "{{ docker_apt_gpg_key_checksum | default(omit) }}"
register: add_repository_key
ignore_errors: "{{ docker_apt_ignore_key_error }}"
when: docker_add_repo | bool
- name: Change permissions for /etc/apt/keyrings/docker.gpg - name: Change permissions for /etc/apt/keyrings/docker.gpg
file: file: