From 3273aab3f70f4b62c9a422ee9d1f49dd7a75b9f7 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 16 Aug 2023 20:32:52 +0200 Subject: fix some ansible-lint warnings --- roles/apt_repo/tasks/main.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'roles/apt_repo') diff --git a/roles/apt_repo/tasks/main.yml b/roles/apt_repo/tasks/main.yml index 3ad7642..4c1d92f 100644 --- a/roles/apt_repo/tasks/main.yml +++ b/roles/apt_repo/tasks/main.yml @@ -21,11 +21,16 @@ dest: '{{ key_path }}' mode: '644' - - name: Get host distribution + - name: Get host distro ansible.builtin.setup: gather_subset: [distribution_release] + - name: Set repository defaults + ansible.builtin.set_fact: + apt_repo_distro: '{{ apt_repo_distro | default(ansible_distribution_release) }}' + apt_repo_component: '{{ apt_repo_component | default("main") }}' + - name: 'Add repository: {{ apt_repo_name }}' ansible.builtin.apt_repository: - repo: 'deb [signed-by={{ key_path }}] {{ apt_repo_url }} {{ apt_repo_distro | default(ansible_distribution_release) }} {{ apt_repo_component | default("main") }}' + repo: 'deb [signed-by={{ key_path }}] {{ apt_repo_url }} {{ apt_repo_distro }} {{ apt_repo_component }}' filename: '{{ apt_repo_name }}' -- cgit v1.2.3