Skip to content

Commit 839ad59

Browse files
asm0deuzguits
authored andcommitted
Add cluster custom name support
When using cluster custom names, cephadm commands are executed using the default admin keyring name which fails. Signed-off-by: Teoman ONAY <tonay@redhat.com> (cherry picked from commit f8c6bba)
1 parent c3ce6fc commit 839ad59

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

infrastructure-playbooks/cephadm-adopt.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@
495495
register: remote_user_keyring
496496

497497
- name: get quorum_status
498-
command: "{{ ceph_cmd }} quorum_status --format json"
498+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph quorum_status --format json"
499499
changed_when: false
500500
delegate_to: "{{ groups[mon_group_name][0] }}"
501501
register: quorum_status
@@ -581,7 +581,7 @@
581581
- /etc/systemd/system/ceph-mon.target
582582

583583
- name: waiting for the monitor to join the quorum...
584-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} quorum_status --format json"
584+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph quorum_status --format json"
585585
changed_when: false
586586
register: ceph_health_raw
587587
until: >
@@ -678,7 +678,7 @@
678678
name: ceph-defaults
679679

680680
- name: update the placement of iscsigw hosts
681-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply iscsi {{ iscsi_pool_name | default('rbd') }} {{ api_user | default('admin') }} {{ api_password | default('admin') }} {{ trusted_ip_list | default('192.168.122.1') }} --placement='{{ groups.get(iscsi_gw_group_name, []) | length }} label:{{ iscsi_gw_group_name }}'"
681+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply iscsi {{ iscsi_pool_name | default('rbd') }} {{ api_user | default('admin') }} {{ api_password | default('admin') }} {{ trusted_ip_list | default('192.168.122.1') }} --placement='{{ groups.get(iscsi_gw_group_name, []) | length }} label:{{ iscsi_gw_group_name }}'"
682682
run_once: true
683683
changed_when: false
684684
delegate_to: '{{ groups[mon_group_name][0] }}'
@@ -824,7 +824,7 @@
824824
loop: '{{ (osd_list.stdout | from_json).keys() | list }}'
825825

826826
- name: waiting for clean pgs...
827-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} pg stat --format json"
827+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph pg stat --format json"
828828
changed_when: false
829829
register: ceph_health_post
830830
until: >
@@ -892,7 +892,7 @@
892892
name: ceph-defaults
893893

894894
- name: update the placement of metadata hosts
895-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply mds {{ cephfs }} --placement='{{ groups.get(mds_group_name, []) | length }} label:{{ mds_group_name }}'"
895+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply mds {{ cephfs }} --placement='{{ groups.get(mds_group_name, []) | length }} label:{{ mds_group_name }}'"
896896
run_once: true
897897
changed_when: false
898898
delegate_to: "{{ groups[mon_group_name][0] }}"
@@ -993,7 +993,7 @@
993993

994994
- name: update the placement of radosgw hosts
995995
command: >
996-
{{ cephadm_cmd }} shell --fsid {{ fsid }} --
996+
{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} --
997997
ceph --cluster {{ cluster }} orch apply rgw {{ ansible_facts['hostname'] }}
998998
--placement='count-per-host:{{ radosgw_num_instances }} {{ ansible_facts['nodename'] }}'
999999
--port={{ radosgw_frontend_port }}
@@ -1006,7 +1006,7 @@
10061006

10071007
- name: update the placement of radosgw multisite hosts
10081008
command: >
1009-
{{ cephadm_cmd }} shell --fsid {{ fsid }} --
1009+
{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} --
10101010
ceph --cluster {{ cluster }} orch apply rgw {{ ansible_facts['hostname'] }}.{{ item.rgw_realm }}.{{ item.rgw_zone }}.{{ item.radosgw_frontend_port }}
10111011
--placement={{ ansible_facts['nodename'] }}
10121012
--realm={{ item.rgw_realm }} --zone={{ item.rgw_zone }}
@@ -1127,22 +1127,22 @@
11271127
state: absent
11281128

11291129
- name: create nfs ganesha cluster
1130-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} nfs cluster create {{ ansible_facts['hostname'] }} {{ ansible_facts['hostname'] }}"
1130+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph nfs cluster create {{ ansible_facts['hostname'] }} {{ ansible_facts['hostname'] }}"
11311131
changed_when: false
11321132
delegate_to: "{{ groups[mon_group_name][0] }}"
11331133
environment:
11341134
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
11351135

11361136
- name: create cephfs export
1137-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} nfs export create cephfs {{ cephfs }} {{ ansible_facts['hostname'] }} {{ ceph_nfs_ceph_pseudo_path }} --squash {{ ceph_nfs_ceph_squash }}"
1137+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph nfs export create cephfs {{ cephfs }} {{ ansible_facts['hostname'] }} {{ ceph_nfs_ceph_pseudo_path }} --squash {{ ceph_nfs_ceph_squash }}"
11381138
changed_when: false
11391139
delegate_to: "{{ groups[mon_group_name][0] }}"
11401140
environment:
11411141
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
11421142
when: nfs_file_gw | bool
11431143

11441144
- name: create rgw export
1145-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} nfs export create rgw --cluster-id {{ ansible_facts['hostname'] }} --pseudo-path {{ ceph_nfs_rgw_pseudo_path }} --user-id {{ ceph_nfs_rgw_user }} --squash {{ ceph_nfs_rgw_squash }}"
1145+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph nfs export create rgw --cluster-id {{ ansible_facts['hostname'] }} --pseudo-path {{ ceph_nfs_rgw_pseudo_path }} --user-id {{ ceph_nfs_rgw_user }} --squash {{ ceph_nfs_rgw_squash }}"
11461146
changed_when: false
11471147
delegate_to: "{{ groups[mon_group_name][0] }}"
11481148
environment:
@@ -1159,7 +1159,7 @@
11591159
name: ceph-defaults
11601160

11611161
- name: update the placement of rbd-mirror hosts
1162-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply rbd-mirror --placement='{{ groups.get(rbdmirror_group_name, []) | length }} label:{{ rbdmirror_group_name }}'"
1162+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply rbd-mirror --placement='{{ groups.get(rbdmirror_group_name, []) | length }} label:{{ rbdmirror_group_name }}'"
11631163
run_once: true
11641164
changed_when: false
11651165
delegate_to: "{{ groups[mon_group_name][0] }}"
@@ -1234,7 +1234,7 @@
12341234
state: absent
12351235

12361236
- name: update the placement of ceph-crash hosts
1237-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply crash --placement='label:ceph'"
1237+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply crash --placement='label:ceph'"
12381238
run_once: true
12391239
changed_when: false
12401240
delegate_to: '{{ groups[mon_group_name][0] }}'
@@ -1443,7 +1443,7 @@
14431443
state: absent
14441444

14451445
- name: update the placement of node-exporter hosts
1446-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply node-exporter --placement='*'"
1446+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply node-exporter --placement='*'"
14471447
run_once: true
14481448
changed_when: false
14491449
delegate_to: '{{ groups[mon_group_name][0] }}'
@@ -1461,7 +1461,7 @@
14611461
name: ceph-defaults
14621462

14631463
- name: update the placement of monitor hosts
1464-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply mon --placement='{{ groups.get(mon_group_name, []) | length }} label:{{ mon_group_name }}'"
1464+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply mon --placement='{{ groups.get(mon_group_name, []) | length }} label:{{ mon_group_name }}'"
14651465
changed_when: false
14661466
environment:
14671467
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
@@ -1475,7 +1475,7 @@
14751475
mgr_placement_label: "{{ mgr_group_name if groups.get(mgr_group_name, []) | length > 0 else mon_group_name }}"
14761476

14771477
- name: update the placement of manager hosts
1478-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply mgr --placement='{{ mgr_placement_count }} label:{{ mgr_placement_label }}'"
1478+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply mgr --placement='{{ mgr_placement_count }} label:{{ mgr_placement_label }}'"
14791479
changed_when: false
14801480
environment:
14811481
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
@@ -1484,19 +1484,19 @@
14841484
when: dashboard_enabled | bool
14851485
block:
14861486
- name: update the placement of alertmanager hosts
1487-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply alertmanager --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'"
1487+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply alertmanager --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'"
14881488
changed_when: false
14891489
environment:
14901490
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
14911491

14921492
- name: update the placement of grafana hosts
1493-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply grafana --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'"
1493+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply grafana --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'"
14941494
changed_when: false
14951495
environment:
14961496
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
14971497

14981498
- name: update the placement of prometheus hosts
1499-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply prometheus --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'"
1499+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply prometheus --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'"
15001500
changed_when: false
15011501
environment:
15021502
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
@@ -1511,13 +1511,13 @@
15111511
name: ceph-defaults
15121512

15131513
- name: show ceph orchestrator services
1514-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch ls --refresh"
1514+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch ls --refresh"
15151515
changed_when: false
15161516
environment:
15171517
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
15181518

15191519
- name: show ceph orchestrator daemons
1520-
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch ps --refresh"
1520+
command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch ps --refresh"
15211521
changed_when: false
15221522
environment:
15231523
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'

0 commit comments

Comments
 (0)