From c7a5875b1eda5fa79f71341345d43ad0b6546312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Estrella?= Date: Mon, 4 Nov 2019 21:56:30 -0500 Subject: [PATCH] Pull GPG key from a different source (Debian/Ubuntu) --- README.md | 3 ++- defaults/main.yml | 3 ++- tasks/setup-Debian.yml | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9a49840..bdbc0c8 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ Docker Compose installation options. docker_apt_release_channel: stable docker_apt_arch: amd64 - docker_apt_repository: "deb [arch={{ docker_apt_arch }}] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" + docker_apt_key: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg" + docker_apt_repository: "deb [arch={{ docker_apt_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" docker_apt_ignore_key_error: True (Used only for Debian/Ubuntu.) You can switch the channel to `edge` if you want to use the Edge release. diff --git a/defaults/main.yml b/defaults/main.yml index 3a9cc47..3fa0d81 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -17,7 +17,8 @@ docker_compose_path: /usr/local/bin/docker-compose # Used only for Debian/Ubuntu. Switch 'stable' to 'edge' if needed. docker_apt_release_channel: stable docker_apt_arch: amd64 -docker_apt_repository: "deb [arch={{ docker_apt_arch }}] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" +docker_apt_key: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg" +docker_apt_repository: "deb [arch={{ docker_apt_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" docker_apt_ignore_key_error: true # Used only for RedHat/CentOS/Fedora. diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index eaaa96f..41bc834 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -15,7 +15,7 @@ - name: Add Docker apt key. apt_key: - url: https://download.docker.com/linux/ubuntu/gpg + url: "{{ docker_apt_key }}" id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 state: present register: add_repository_key @@ -28,7 +28,7 @@ - name: Add Docker apt key (alternative for older systems without SNI). shell: | set -o pipefail - curl -sSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + curl -sSL {{ docker_apt_key }} | sudo apt-key add - args: warn: false when: add_repository_key is failed