fix: keep all lines under 160 chars for yamllint

Use set_fact to build the Docker repo line in parts instead of
one long inline string.
This commit is contained in:
Rasmus Wejlgaard 2026-03-29 20:06:32 +00:00
parent be96f205df
commit 7197913f8e

View file

@ -18,9 +18,28 @@
mode: '0755'
when: ansible_facts["os_family"] == "Debian"
- name: Set Docker repo variables
ansible.builtin.set_fact:
docker_distro: >-
{{ 'ubuntu' if ansible_facts['distribution'] == 'Ubuntu' else 'debian' }}
docker_arch: >-
{{ ansible_facts['architecture']
| regex_replace('x86_64', 'amd64')
| regex_replace('aarch64', 'arm64') }}
when: ansible_facts["os_family"] == "Debian"
- name: Build Docker repo line
ansible.builtin.set_fact:
docker_repo: >-
deb [arch={{ docker_arch }}
signed-by=/etc/apt/keyrings/docker.asc]
https://download.docker.com/linux/{{ docker_distro }}
{{ ansible_facts['distribution_release'] }} stable
when: ansible_facts["os_family"] == "Debian"
- name: Add Docker GPG key
ansible.builtin.get_url:
url: "https://download.docker.com/linux/{{ 'ubuntu' if ansible_facts['distribution'] == 'Ubuntu' else 'debian' }}/gpg"
url: "https://download.docker.com/linux/{{ docker_distro }}/gpg"
dest: /etc/apt/keyrings/docker.asc
mode: '0644'
force: false
@ -28,7 +47,7 @@
- name: Add Docker apt repository
ansible.builtin.apt_repository:
repo: "deb [arch={{ ansible_facts['architecture'] | regex_replace('x86_64', 'amd64') | regex_replace('aarch64', 'arm64') }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/{{ 'ubuntu' if ansible_facts['distribution'] == 'Ubuntu' else 'debian' }} {{ ansible_facts['distribution_release'] }} stable"
repo: "{{ docker_repo }}"
filename: docker
state: present
update_cache: true