mirror of
https://github.com/RWejlgaard/pez-infra.git
synced 2026-05-06 04:14:43 +00:00
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:
parent
be96f205df
commit
7197913f8e
1 changed files with 21 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue