Skip to content

Commit 6a7967a

Browse files
authored
Merge pull request #61 from stackhpc/no-apt-key
Stop using apt-key
2 parents 597fbb6 + 3a2b112 commit 6a7967a

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

roles/cephadm/tasks/pkg_debian.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,34 @@
11
---
2-
- name: Add Ceph signing keys
2+
# Remove any old Ceph keys added to the main keyring.
3+
- name: Clean up old key
34
apt_key:
4-
keyserver: keyserver.ubuntu.com
55
id: E84AC2C0460F3994
6+
state: absent
7+
become: true
8+
9+
- name: Ensure keys directory exists
10+
file:
11+
path: "{{ cephadm_apt_key_path | dirname }}"
12+
owner: root
13+
group: root
14+
mode: 0755
15+
state: directory
16+
when: not cephadm_custom_repos | bool
17+
become: true
18+
19+
- name: Ensure keys exist
20+
get_url:
21+
url: "{{ cephadm_apt_key_url }}"
22+
dest: "{{ cephadm_apt_key_path }}"
23+
owner: root
24+
group: root
25+
mode: 0644
26+
when: not cephadm_custom_repos | bool
627
become: true
728

829
- name: Ensure Ceph repositories are defined
930
apt_repository:
10-
repo: "deb https://download.ceph.com/debian-{{ item }}/ {{ cephadm_apt_repo_dist }} main"
31+
repo: "deb [signed-by={{ cephadm_apt_key_path }}] https://download.ceph.com/debian-{{ item }}/ {{ cephadm_apt_repo_dist }} main"
1132
state: "{{ 'present' if item == cephadm_ceph_release else 'absent' }}"
1233
when: not cephadm_custom_repos | bool
1334
become: true

roles/cephadm/vars/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ cephadm_rpm_repos:
55
cephadm_ceph_releases:
66
- "octopus"
77
- "pacific"
8+
cephadm_apt_key_url: "https://download.ceph.com/keys/release.asc"
9+
cephadm_apt_key_path: "/usr/local/share/keyrings/ceph.asc"

0 commit comments

Comments
 (0)