aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/apt_repo/defaults/main.yml1
-rw-r--r--roles/apt_repo/tasks/main.yml6
-rw-r--r--roles/linux_status/tasks/main.yml1
-rw-r--r--roles/ppa/tasks/main.yml6
4 files changed, 10 insertions, 4 deletions
diff --git a/roles/apt_repo/defaults/main.yml b/roles/apt_repo/defaults/main.yml
index 0877adf..6d09a7b 100644
--- a/roles/apt_repo/defaults/main.yml
+++ b/roles/apt_repo/defaults/main.yml
@@ -1,2 +1 @@
apt_repo_keys_dir: /etc/apt/keyrings
-apt_repo_component: main
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 }}'
diff --git a/roles/linux_status/tasks/main.yml b/roles/linux_status/tasks/main.yml
index 0d93070..70fd41b 100644
--- a/roles/linux_status/tasks/main.yml
+++ b/roles/linux_status/tasks/main.yml
@@ -4,7 +4,6 @@
vars:
ppa_owner: egor-tensin
ppa_name: linux-status
- ppa_distro: focal
ppa_key: ecb69cbafc6d7cd8bd67ec35b1089b3051c9384d
- name: Install linux-status
diff --git a/roles/ppa/tasks/main.yml b/roles/ppa/tasks/main.yml
index 01d6809..918a61c 100644
--- a/roles/ppa/tasks/main.yml
+++ b/roles/ppa/tasks/main.yml
@@ -1,3 +1,7 @@
+- name: Get host distribution
+ ansible.builtin.setup:
+ gather_subset: [distribution_release]
+
- name: Set up PPA repository
ansible.builtin.include_role:
name: apt_repo
@@ -5,4 +9,4 @@
apt_repo_name: '{{ ppa_name }}'
apt_repo_key_url: 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x{{ ppa_key }}'
apt_repo_url: 'https://ppa.launchpadcontent.net/{{ ppa_owner }}/{{ ppa_name }}/ubuntu'
- apt_repo_distro: '{{ ppa_distro }}'
+ apt_repo_distro: '{{ ppa_distro | default(ansible_distribution_release) }}'