When performing a rolling update using ceph-ansible it is very likely that you may enconter an error related to the reuse of the existing monitor keyring (which is cluster-wide):
"TASK [ceph-mon : generate monitor initial keyring] *****************************",
"Monday 22 February 2021 12:48:51 +0100 (0:00:01.424) 0:13:29.596 ******* ",
"TASK [ceph-mon : get initial keyring when it already exists] *******************",
"Monday 22 February 2021 12:48:51 +0100 (0:00:00.059) 0:13:29.655 ******* ",
"FAILED! => {\"msg\": \"the field 'args' has an invalid value ({'monitor_keyring': \\\"{{ (initial_mon_key.stdout | from_json)[0]['key'] if initial_mon_key is not skipped else monitor_keyring.stdout }}\\\"}), and could not be converted to an dict.The error was: Expecting value: line 1 column 1 (char 0)\\n\\nThe error appears to be in '/usr/share/ceph-ansible/roles/ceph-mon/tasks/deploy_monitors.yml': line 26, column 3, but may\\nbe elsewhere in the file depending on the exact syntax problem.\\n\\nThe offending line appears to be:\\n\\n\\n- name: get initial keyring when it already exists\\n ^ here\\n\"}",
This is AFAIK a bug in the roles/ceph-mon/tasks/deploy-monitors.yml, line 30. A simple workaround is to replace the json query by the actual key value that you may get from /etc/ceph/ceph.mon.keyring:
[mon.]
key = AAAAAAAAAABBBBBBBBBBBBccccccccc==
caps mon = "allow *"
So the task now becomes:
- name: get initial keyring when it already exists
set_fact:
monitor_keyring: "{{ 'AAAAAAAAAABBBBBBBBBBBBccccccccc==' if initial_mon_key is not skipped else monitor_keyring.stdout }}"
when: initial_mon_key.stdout|default('')|length > 0 or monitor_keyring is not skipped
And the Playbook may proceed. Hope it helps.
Trying to update a ceph cluster (minor to minor) Expected it to go smoothly.