From 43b5ad4fef027c2e32f3160ad9cb3a7515d88642 Mon Sep 17 00:00:00 2001 From: Dale Anderson Date: Fri, 30 Dec 2022 14:56:00 -0800 Subject: [PATCH 1/6] Override defaults for Pop!_OS --- vars/Pop!_OS.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 vars/Pop!_OS.yml diff --git a/vars/Pop!_OS.yml b/vars/Pop!_OS.yml new file mode 100644 index 0000000..805a36b --- /dev/null +++ b/vars/Pop!_OS.yml @@ -0,0 +1,13 @@ +--- +# Since: +# * `ansible_distribution` evaluates to Pop!_OS, and +# * docker does not (yet) support Pop!_OS, and +# * Pop_OS is effectively Ubuntu (for our purposes), and +# * There isn't a 'better' variable we easily use +# we need to just wire in 'ubuntu' instead of relying on `ansible_distribution`. + +# If "https://download.docker.com/linux/pop!_os/gpg" ever exists, this can be removed. +docker_apt_gpg_key: "{{ docker_repo_url }}/ubuntu/gpg" + +# If "https://download.docker.com/linux/pop!_os/....." ever exists, this can be removed. +docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ docker_repo_url }}/ubuntu {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" From 48688d0fafa3003b90f72ab6a9ac78bd5c8b6e2c Mon Sep 17 00:00:00 2001 From: Dale Anderson Date: Fri, 30 Dec 2022 15:17:35 -0800 Subject: [PATCH 2/6] Handle the exception more cleanly --- defaults/main.yml | 5 +++-- vars/Pop!_OS.yml | 13 ------------- 2 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 vars/Pop!_OS.yml diff --git a/defaults/main.yml b/defaults/main.yml index 685b8de..6f3fd6f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -31,10 +31,11 @@ docker_repo_url: https://download.docker.com/linux # Used only for Debian/Ubuntu. Switch 'stable' to 'nightly' if needed. docker_apt_release_channel: stable +docker_apt_ansible_distro_name: "{{ 'ubuntu' if ansible_distribution == 'Pop!_OS' else ansible_distribution }}" docker_apt_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}" -docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ docker_repo_url }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" +docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ docker_repo_url }}/{{ docker_apt_ansible_distro_name | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" docker_apt_ignore_key_error: true -docker_apt_gpg_key: "{{ docker_repo_url }}/{{ ansible_distribution | lower }}/gpg" +docker_apt_gpg_key: "{{ docker_repo_url }}/{{ docker_apt_ansible_distro_name | lower }}/gpg" # Used only for RedHat/CentOS/Fedora. docker_yum_repo_url: "{{ docker_repo_url }}/{{ (ansible_distribution == 'Fedora') | ternary('fedora','centos') }}/docker-{{ docker_edition }}.repo" diff --git a/vars/Pop!_OS.yml b/vars/Pop!_OS.yml deleted file mode 100644 index 805a36b..0000000 --- a/vars/Pop!_OS.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# Since: -# * `ansible_distribution` evaluates to Pop!_OS, and -# * docker does not (yet) support Pop!_OS, and -# * Pop_OS is effectively Ubuntu (for our purposes), and -# * There isn't a 'better' variable we easily use -# we need to just wire in 'ubuntu' instead of relying on `ansible_distribution`. - -# If "https://download.docker.com/linux/pop!_os/gpg" ever exists, this can be removed. -docker_apt_gpg_key: "{{ docker_repo_url }}/ubuntu/gpg" - -# If "https://download.docker.com/linux/pop!_os/....." ever exists, this can be removed. -docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ docker_repo_url }}/ubuntu {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" From a6bab2c9bed848d155eb08b7d644887472193942 Mon Sep 17 00:00:00 2001 From: Dale Anderson Date: Fri, 30 Dec 2022 15:46:38 -0800 Subject: [PATCH 3/6] Make naming more consistent --- defaults/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 6f3fd6f..e0fca24 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -29,13 +29,13 @@ docker_compose_path: /usr/local/bin/docker-compose # Docker repo URL. docker_repo_url: https://download.docker.com/linux -# Used only for Debian/Ubuntu. Switch 'stable' to 'nightly' if needed. +# Used only for Debian/Ubuntu/Pop!_OS. Switch 'stable' to 'nightly' if needed. docker_apt_release_channel: stable -docker_apt_ansible_distro_name: "{{ 'ubuntu' if ansible_distribution == 'Pop!_OS' else ansible_distribution }}" +docker_apt_ansible_distribution: "{{ 'ubuntu' if ansible_distribution == 'Pop!_OS' else ansible_distribution }}" # If Docker ever officially supports Pop!_OS, this can be removed. docker_apt_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}" -docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ docker_repo_url }}/{{ docker_apt_ansible_distro_name | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" +docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ docker_repo_url }}/{{ docker_apt_ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" docker_apt_ignore_key_error: true -docker_apt_gpg_key: "{{ docker_repo_url }}/{{ docker_apt_ansible_distro_name | lower }}/gpg" +docker_apt_gpg_key: "{{ docker_repo_url }}/{{ docker_apt_ansible_distribution | lower }}/gpg" # Used only for RedHat/CentOS/Fedora. docker_yum_repo_url: "{{ docker_repo_url }}/{{ (ansible_distribution == 'Fedora') | ternary('fedora','centos') }}/docker-{{ docker_edition }}.repo" From 75b8acc62652d101585c793c17c45ababa829d0c Mon Sep 17 00:00:00 2001 From: Dale Anderson Date: Mon, 23 Jan 2023 17:40:17 -0800 Subject: [PATCH 4/6] Linux Mint is also Ubuntu under the hood Closes #334 --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index e0fca24..888df0e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -31,7 +31,7 @@ docker_repo_url: https://download.docker.com/linux # Used only for Debian/Ubuntu/Pop!_OS. Switch 'stable' to 'nightly' if needed. docker_apt_release_channel: stable -docker_apt_ansible_distribution: "{{ 'ubuntu' if ansible_distribution == 'Pop!_OS' else ansible_distribution }}" # If Docker ever officially supports Pop!_OS, this can be removed. +docker_apt_ansible_distribution: "{{ 'ubuntu' if ansible_distribution in ['Pop!_OS', 'Linux Mint'] else ansible_distribution }}" # Only necessary until Docker officially supports Pop!_OS and Linux Mint docker_apt_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}" docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ docker_repo_url }}/{{ docker_apt_ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" docker_apt_ignore_key_error: true From 26385299274196be82f3b94dce16b1f8907a57d8 Mon Sep 17 00:00:00 2001 From: Dale Anderson Date: Mon, 23 Jan 2023 17:50:49 -0800 Subject: [PATCH 5/6] Fix linter warning --- defaults/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 888df0e..5c6167f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -29,9 +29,11 @@ docker_compose_path: /usr/local/bin/docker-compose # Docker repo URL. docker_repo_url: https://download.docker.com/linux -# Used only for Debian/Ubuntu/Pop!_OS. Switch 'stable' to 'nightly' if needed. +# Used only for Debian/Ubuntu/Pop!_OS/Linux Mint. Switch 'stable' to 'nightly' if needed. docker_apt_release_channel: stable -docker_apt_ansible_distribution: "{{ 'ubuntu' if ansible_distribution in ['Pop!_OS', 'Linux Mint'] else ansible_distribution }}" # Only necessary until Docker officially supports Pop!_OS and Linux Mint +# docker_apt_ansible_distribution is a workaround for Ubuntu variants which can't be identified as such by Ansible, +# 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_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}" docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ docker_repo_url }}/{{ docker_apt_ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" docker_apt_ignore_key_error: true From a23731506ba2f8ad7fc38b4021eace03dfca7e35 Mon Sep 17 00:00:00 2001 From: Dale Anderson Date: Thu, 10 Aug 2023 09:12:33 -0700 Subject: [PATCH 6/6] Restore snippet lost in previous conflict --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0122d14..77034eb 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -38,7 +38,7 @@ docker_apt_release_channel: stable # 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_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}" -docker_apt_repository: "deb [arch={{ docker_apt_arch }}] {{ 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/trusted.gpg.d/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_gpg_key: "{{ docker_repo_url }}/{{ ansible_distribution | lower }}/gpg" docker_apt_gpg_key_checksum: "sha256:1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570"