Update deb822 condition and variable name

This commit is contained in:
LaggingHero 2025-02-12 16:40:55 +01:00
parent de0ec22581
commit d3e340b976
2 changed files with 6 additions and 6 deletions

View File

@ -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. 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 ```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`. 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`.

View File

@ -1,11 +1,11 @@
--- ---
- name: Check if deb822 format should be used and save it as a fact - name: Check if deb822 format should be used and save it as a fact
vars: vars:
is_ubuntu2404_or_greater: >- is_ubuntu2304_or_greater: "{{ ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('23.04', '>=') }}"
{{ ansible_distribution == "Ubuntu" and ansible_distribution_version is version('24.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: ansible.builtin.set_fact:
docker_use_deb822_format: >- docker_use_deb822_format: "{{ docker_apt_deb822_format | default(is_deb822_preferred) }}"
{{ docker_deb822_format | default(is_ubuntu2404_or_greater) }}
- name: Ensure apt key is not present in trusted.gpg.d - name: Ensure apt key is not present in trusted.gpg.d
ansible.builtin.file: ansible.builtin.file: