Skip to content

Commit 06ed0ec

Browse files
chore: migrate to new apt repositories and upgrade erlang (#188)
* chore: migrate to new apt repositories * chore: upgrade erlang version * chore: upgrade toolbox * fix: toolbox version with windows fix
1 parent b567af0 commit 06ed0ec

3 files changed

Lines changed: 32 additions & 13 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AMI_ARCH=x86_64
33
AMI_PREFIX=semaphore-agent
44
AMI_INSTANCE_TYPE=t2.micro
55
AGENT_VERSION=v2.2.16
6-
TOOLBOX_VERSION=v1.20.5
6+
TOOLBOX_VERSION=v1.38.4
77
PACKER_OS=linux
88
UBUNTU_VERSION=focal
99
SOURCE_AMI?=

packer/linux/ansible/group_vars/all.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ awscli_url: "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-{{ awscli_vers
77
docker_apt_repository: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
88
docker_apt_gpg_key: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg"
99
yq_url: "https://github.com/mikefarah/yq/releases/download/v4.16.2/yq_linux_amd64"
10-
erlang_gpg_key_url: https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-erlang.E495BB49CC4BBE5B.key
11-
erlang_gpg_key_checksum: "84df2e5fd80d464c3eb9acd2f751b2f6a723438200915dd50fbf12f08698e4ec"
12-
erlang_gpg_key_path: /usr/share/keyrings/rabbitmq-erlang.E495BB49CC4BBE5B.asc
10+
erlang_gpg_key_url: https://keys.openpgp.org/vks/v1/by-fingerprint/0A9AF2115F4687BD29803A206B73A36E6026DFCA
11+
erlang_gpg_key_checksum: "f06ccb0568a012e751e276c15b733494147fbb0663c79ab77f3574def4767f99"
12+
erlang_gpg_key_path: /usr/share/keyrings/com.rabbitmq.team.gpg
13+
erlang_gpg_key_source_path: "{{ erlang_gpg_key_path }}.asc"
14+
erlang_repo_mirrors:
15+
- https://deb1.rabbitmq.com
16+
- https://deb2.rabbitmq.com
17+
erlang_package_specs:
18+
# Pin Erlang 26.2.5.13 across all Ubuntu releases for consistent builds.
19+
default: erlang-base=1:26.2.5.13-1
1320
cloudwatch_agent_url: https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb
1421
systemd_restart_seconds: 300
1522
apt_hold_patterns: []
Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
---
22
- name: Download GPG key
3+
register: erlang_gpg_key_download
34
ansible.builtin.get_url:
45
url: "{{ erlang_gpg_key_url }}"
5-
dest: "{{ erlang_gpg_key_path }}"
6+
dest: "{{ erlang_gpg_key_source_path }}"
67
checksum: "sha256:{{ erlang_gpg_key_checksum }}"
7-
mode: '0755'
8+
mode: '0644'
89
force: true
910

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
1415

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"
1622
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
1827
state: present
28+
loop: "{{ erlang_repo_mirrors }}"
29+
loop_control:
30+
label: "{{ item }}"
1931

2032
- name: Install Erlang
2133
when: install_erlang | bool
2234
ansible.builtin.apt:
2335
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

Comments
 (0)