diff options
author | Oliver Smith <osmith@sysmocom.de> | 2022-10-12 14:27:53 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2022-10-13 10:51:55 +0200 |
commit | f9c90691510b45ed030cbd09b9379df81f0ffedc (patch) | |
tree | c1ea9f53968a3e700ff8d74eaf1c03014a1efb1d /ansible | |
parent | ed03bc78ed7e07d4c40beafbb0e072d4108e4661 (diff) |
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
Diffstat (limited to 'ansible')
-rw-r--r-- | ansible/roles/osmocom-jenkins-slave/tasks/ttcn3-slave.yml | 9 |
1 files changed, 7 insertions, 2 deletions
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 |