diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-11-20 01:25:24 +0100 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-11-20 01:25:24 +0100 |
commit | c43f7364879ed6f18796c532ca31f9a8cff5eaff (patch) | |
tree | 64ac66809ee46a9483f4867363af47fe8885905c /roles/ppa/tasks | |
parent | docker: add Arch-specific package names (diff) | |
download | infra-ansible-c43f7364879ed6f18796c532ca31f9a8cff5eaff.tar.gz infra-ansible-c43f7364879ed6f18796c532ca31f9a8cff5eaff.zip |
ppa: derive the distribution automatically
Diffstat (limited to 'roles/ppa/tasks')
-rw-r--r-- | roles/ppa/tasks/main.yml | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/roles/ppa/tasks/main.yml b/roles/ppa/tasks/main.yml index e71a2a8..4a86ced 100644 --- a/roles/ppa/tasks/main.yml +++ b/roles/ppa/tasks/main.yml @@ -1,6 +1,19 @@ - name: Get host distro ansible.builtin.setup: - gather_subset: [distribution_release] + gather_subset: + - distribution + - distribution_major_version + - distribution_release + - os_family + +- name: Set platform-specific variables + ansible.builtin.include_vars: "{{ __ppa_vars_file }}" + loop: + - "{{ ansible_facts['os_family'] }}.yml" + - "{{ ansible_facts['distribution'] }}_{{ ansible_facts['distribution_major_version'] }}.yml" + vars: + __ppa_vars_file: "{{ role_path }}/vars/{{ item }}" + when: __ppa_vars_file is file - name: Set up PPA repository ansible.builtin.include_role: @@ -9,4 +22,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 | default(ansible_distribution_release) }}' + apt_repo_distro: '{{ ppa_distro }}' |