42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
---
|
|
|
|
- name: Install dependencies
|
|
ansible.builtin.apt:
|
|
name:
|
|
- apt-transport-https
|
|
- ca-certificates
|
|
- gnupg
|
|
update_cache: true
|
|
|
|
- name: Initialize repo_options
|
|
ansible.builtin.set_fact:
|
|
repo_options: []
|
|
|
|
- name: Add arch to repo_options
|
|
ansible.builtin.set_fact:
|
|
repo_options: "{{ repo_options + ['arch=' + repo_arch] }}"
|
|
when: repo_arch | length > 0
|
|
|
|
- name: Esnure /etc/apt/keyrings exists
|
|
ansible.builtin.file:
|
|
path: /etc/apt/keyrings
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Get repo signing key
|
|
ansible.builtin.get_url:
|
|
url: "{{ repo_key_url }}"
|
|
dest: /etc/apt/keyrings/{{ repo_name }}.asc
|
|
mode: "0644"
|
|
register: repo_key
|
|
|
|
- name: Add signed-by to repo_options
|
|
ansible.builtin.set_fact:
|
|
repo_options: "{{ repo_options + ['signed-by=' + repo_key.dest] }}"
|
|
|
|
- name: Add repo {{ repo_name }}
|
|
ansible.builtin.apt_repository:
|
|
repo: "deb [{{ repo_options | join(' ') }}] {{ repo_url }} {{ repo_suite }} {{ repo_components | join(' ') }}"
|
|
filename: docker
|
|
mode: "0644"
|