|
1 | 1 | --- |
2 | 2 | - name: Download GPG key |
| 3 | + register: erlang_gpg_key_download |
3 | 4 | ansible.builtin.get_url: |
4 | 5 | url: "{{ erlang_gpg_key_url }}" |
5 | | - dest: "{{ erlang_gpg_key_path }}" |
| 6 | + dest: "{{ erlang_gpg_key_source_path }}" |
6 | 7 | checksum: "sha256:{{ erlang_gpg_key_checksum }}" |
7 | | - mode: '0755' |
| 8 | + mode: '0644' |
8 | 9 | force: true |
9 | 10 |
|
10 | | -- name: "Add repository to APT sources list" |
11 | | - ansible.builtin.apt_repository: |
12 | | - repo: "deb [arch=amd64 signed-by={{ erlang_gpg_key_path }}] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/ubuntu focal main" |
13 | | - state: present |
| 11 | +- name: Check existing keyring |
| 12 | + ansible.builtin.stat: |
| 13 | + path: "{{ erlang_gpg_key_path }}" |
| 14 | + register: erlang_gpg_keyring |
14 | 15 |
|
15 | | -- name: "Add src repository to APT sources list" |
| 16 | +- name: De-Armor GPG key |
| 17 | + ansible.builtin.command: |
| 18 | + cmd: "gpg --dearmor --yes --output {{ erlang_gpg_key_path }} {{ erlang_gpg_key_source_path }}" |
| 19 | + when: erlang_gpg_key_download.changed or not erlang_gpg_keyring.stat.exists |
| 20 | + |
| 21 | +- name: "Add repository to APT sources list" |
16 | 22 | ansible.builtin.apt_repository: |
17 | | - repo: "deb-src [signed-by={{ erlang_gpg_key_path }}] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/ubuntu focal main" |
| 23 | + repo: >- |
| 24 | + deb [arch=amd64 signed-by={{ erlang_gpg_key_path }}] |
| 25 | + {{ item }}/rabbitmq-erlang/{{ ansible_distribution | lower }}/{{ ansible_distribution_release }} |
| 26 | + {{ ansible_distribution_release }} main |
18 | 27 | state: present |
| 28 | + loop: "{{ erlang_repo_mirrors }}" |
| 29 | + loop_control: |
| 30 | + label: "{{ item }}" |
19 | 31 |
|
20 | 32 | - name: Install Erlang |
21 | 33 | when: install_erlang | bool |
22 | 34 | ansible.builtin.apt: |
23 | 35 | pkg: |
24 | | - - erlang-base=1:24.3.4.17-1 |
| 36 | + - "{{ erlang_package_specs.get(ansible_distribution_release, erlang_package_specs.default) }}" |
0 commit comments