From d3e340b976888eeb960f6fedb8c05e79151dda5f Mon Sep 17 00:00:00 2001 From: LaggingHero Date: Wed, 12 Feb 2025 16:40:55 +0100 Subject: [PATCH] Update deb822 condition and variable name --- README.md | 4 ++-- tasks/setup-Debian.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ed55abe..7307318 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,10 @@ Controls whether this role will add the official Docker repository. Set to `fals For any instance running Ubuntu 24.04 or later, the Docker repository source file will be in `deb822` format by default. -This behavior can be modified using the `docker_deb822_format` variable. For example, if the one-line format is preferred, set the variable as follows: +This behavior can be modified using the `docker_apt_deb822_format` variable. For example, if the one-line format is preferred, set the variable as follows: ```yaml -docker_deb822_format: false +docker_apt_deb822_format: false ``` When set to `true`, the `deb822` format will be used for all Debian-based installations. Note that enabling this will also remove any existing `docker.list` file and install `python3-debian`. diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 1914455..c84d205 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -1,11 +1,11 @@ --- - name: Check if deb822 format should be used and save it as a fact vars: - is_ubuntu2404_or_greater: >- - {{ ansible_distribution == "Ubuntu" and ansible_distribution_version is version('24.04', '>=') }} + is_ubuntu2304_or_greater: "{{ ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('23.04', '>=') }}" + is_debian12_or_greater: "{{ ansible_distribution == 'Debian' and ansible_distribution_version is version('12', '>=') }}" + is_deb822_preferred: "{{ is_ubuntu2304_or_greater or is_debian12_or_greater }}" ansible.builtin.set_fact: - docker_use_deb822_format: >- - {{ docker_deb822_format | default(is_ubuntu2404_or_greater) }} + docker_use_deb822_format: "{{ docker_apt_deb822_format | default(is_deb822_preferred) }}" - name: Ensure apt key is not present in trusted.gpg.d ansible.builtin.file: