Skip to content

Commit 4300825

Browse files
authored
Merge pull request #80 from neoformit/sign-gpg-keys
Proper signing of debian GPG keys
2 parents 5fad83c + db172bc commit 4300825

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

tasks/init_debian.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,54 @@
55
- apt-transport-https
66
- ca-certificates
77

8-
- name: Install CernVM apt key
8+
- name: Remove old CernVM GPG key from legacy keyring
99
ansible.builtin.apt_key:
1010
url: https://cvmrepo.web.cern.ch/cvmrepo/apt/cernvm.gpg
11+
state: absent
12+
ignore_errors: true
13+
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release in ('jammy', 'noble')
1114

12-
- name: Configure CernVM apt repository
15+
- name: Download CernVM GPG key
16+
ansible.builtin.get_url:
17+
url: https://cvmrepo.web.cern.ch/cvmrepo/apt/cernvm.gpg
18+
dest: /usr/share/keyrings/cernvm.gpg
19+
mode: '0644'
20+
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release in ('jammy', 'noble')
21+
22+
- name: Configure CernVM apt repository for non-Ubuntu distributions
1323
ansible.builtin.apt_repository:
14-
filename: cernvm.list
24+
filename: cernvm
1525
mode: 422
16-
repo: deb [allow-insecure=true] https://cvmrepo.web.cern.ch/cvmrepo/apt/ {{ ansible_distribution_release }}-prod main
26+
repo: deb [signed-by=/usr/share/keyrings/cernvm.gpg] https://cvmrepo.web.cern.ch/cvmrepo/apt/ {{ ansible_distribution_release }}-prod main
1727
when: ansible_distribution != 'Ubuntu'
1828

19-
- name: Configure CernVM apt repository
29+
- name: Configure CernVM apt repository for older Ubuntu releases
2030
ansible.builtin.apt_repository:
2131
filename: cernvm.list
2232
mode: 422
2333
repo: deb [allow-insecure=true] https://cvmrepo.web.cern.ch/cvmrepo/apt/ {{ ansible_distribution_release }}-prod main
24-
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release in ('bionic', 'xenial', 'precise', 'focal', 'jammy', 'noble')
34+
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release in ('bionic', 'xenial', 'precise', 'focal')
35+
36+
- name: Configure CernVM apt repository for modern Ubuntu releases
37+
ansible.builtin.apt_repository:
38+
filename: cernvm
39+
mode: 422
40+
repo: deb [signed-by=/usr/share/keyrings/cernvm.gpg] https://cvmrepo.web.cern.ch/cvmrepo/apt/ {{ ansible_distribution_release }}-prod main
41+
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release in ('jammy', 'noble')
2542

2643
# There are no packages for any of the non LTS versions so good
2744
# luck and have fun if that's you.
28-
- name: Configure CernVM apt repository
45+
- name: Configure CernVM apt repository for non-LTS Ubuntu releases
2946
ansible.builtin.apt_repository:
30-
filename: cernvm.list
47+
filename: cernvm
3148
mode: 422
32-
repo: deb [allow-insecure=true] https://cvmrepo.web.cern.ch/cvmrepo/apt/ xenial-prod main
49+
repo: deb [signed-by=/usr/share/keyrings/cernvm.gpg] https://cvmrepo.web.cern.ch/cvmrepo/apt/ xenial-prod main
3350
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release not in ('bionic', 'xenial', 'precise', 'focal', 'jammy', 'noble')
3451

52+
- name: Update apt cache after key changes
53+
ansible.builtin.apt:
54+
update_cache: yes
55+
3556
- name: Install CernVM-FS packages and dependencies (apt)
3657
ansible.builtin.apt:
3758
name: "{{ cvmfs_packages[_cvmfs_role] }}"

0 commit comments

Comments
 (0)