osmith has uploaded this change for review.

View Change

ansible/ttcn3-slave: fix adding apt key

Downloading the apt key from obs.osmocom.org returns a 404 error unless
an Accept HTTP header is sent. (Yes, really.) Also using apt-key is
deprecated, so change it to download the key with get_url as shown in
the ansible docs example.

Fix for:
Failed to download key at https://obs.osmocom.org/projects/osmocom/public_key: HTTP Error 404: Not Found

Related: https://github.com/ansible/ansible/issues/50436#issuecomment-451205256
Related: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_key_module.html#examples
Change-Id: Idb23231d629ba8a75510deace0d1f130e889d535
---
M ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml
1 file changed, 7 insertions(+), 2 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/08/29708/1
diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml b/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml
index 1e61fe5..67717fc 100644
--- a/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml
+++ b/ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml
@@ -15,12 +15,17 @@
dest: "/home/{{ jenkins_user }}/jenkins/docker-playground"

- name: add apt.key
- apt_key:
+ get_url:
url: https://obs.osmocom.org/projects/osmocom/public_key
+ dest: /etc/apt/trusted.gpg.d/obs.osmocom.org.asc
+ # OBS webserver needs this header, returns 404 otherwise
+ # https://github.com/ansible/ansible/issues/50436#issuecomment-451205256
+ headers:
+ Accept: '*/*'

- name: add apt repository
apt_repository:
- repo: "deb https://downloads.osmocom.org/packages/osmocom:/latest/{{ obs_distro }}/ ./"
+ repo: "deb [signed-by=/etc/apt/trusted.gpg.d/obs.osmocom.org.asc] https://downloads.osmocom.org/packages/osmocom:/latest/{{ obs_distro }}/ ./"
filename: obs_osmocom
update_cache: yes


To view, visit change 29708. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Idb23231d629ba8a75510deace0d1f130e889d535
Gerrit-Change-Number: 29708
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-MessageType: newchange