aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/apt_repo/tasks
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-15 21:55:53 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-15 21:55:53 +0200
commita47e4ddc43849f36d58a1b48e0f7a71157a82ae1 (patch)
treedabae680c0f48b9ff1933375f9782824d949b92d /roles/apt_repo/tasks
parentapt_ppa -> ppa (diff)
downloadinfra-ansible-a47e4ddc43849f36d58a1b48e0f7a71157a82ae1.tar.gz
infra-ansible-a47e4ddc43849f36d58a1b48e0f7a71157a82ae1.zip
use ansible_distribution_release as default for APT setup
Diffstat (limited to '')
-rw-r--r--roles/apt_repo/tasks/main.yml6
1 files changed, 5 insertions, 1 deletions
diff --git a/roles/apt_repo/tasks/main.yml b/roles/apt_repo/tasks/main.yml
index 25069bb..b9baffd 100644
--- a/roles/apt_repo/tasks/main.yml
+++ b/roles/apt_repo/tasks/main.yml
@@ -17,7 +17,11 @@
dest: '{{ key_path }}'
mode: '644'
+ - name: Get host distribution
+ ansible.builtin.setup:
+ gather_subset: [distribution_release]
+
- name: 'Add repository: {{ apt_repo_name }}'
ansible.builtin.apt_repository:
- repo: 'deb [signed-by={{ key_path }}] {{ apt_repo_url }} {{ apt_repo_distro }} {{ apt_repo_component }}'
+ repo: 'deb [signed-by={{ key_path }}] {{ apt_repo_url }} {{ apt_repo_distro | default(ansible_distribution_release) }} {{ apt_repo_component | default("main") }}'
filename: '{{ apt_repo_name }}'