Skip to content

Commit

Permalink
Do not force fail ceph-mgr after reconfiguring OSDs
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Dec 20, 2024
1 parent 2264626 commit 9d112bc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions tests/roles/ceph_migrate/tasks/fail_mgr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Get a client using -v /home/tripleo-admin/ceph_config:/etc/ceph:z as input
- name: Refresh ceph_cli
ansible.builtin.include_tasks: ceph_cli.yaml
vars:
ceph_config_home: "{{ ceph_config_tmp_client_home }}"
ceph_fsid: "{{ mon_dump.fsid }}"
ceph_cluster: ceph

- name: Force fail ceph mgr
become: true
ansible.builtin.command: "{{ ceph_cli }} mgr fail"

- name: Wait for cephadm to reconcile
ansible.builtin.pause:
seconds: "{{ ceph_wait_mon_timeout }}"

- name: Get the ceph orchestrator status with
become: true
ansible.builtin.command: "{{ tripleo_cephadm_ceph_cli }} orch status --format json"
register: ceph_orch_status
async: 30
poll: 1
failed_when: false

- name: Restart ceph active mgr if ceph orch is not responding
become: true
when:
- ceph_orch_status.msg is defined
- '"async task did not complete within the requested time" in ceph_orch_status.msg'
block:
- name: Restart the active mgr
ansible.builtin.command: "{{ tripleo_cephadm_ceph_cli }} mgr fail"
# This time we fail because something is wrong
- name: Fail if ceph orchestrator is still not responding
ansible.builtin.command: "{{ tripleo_cephadm_ceph_cli }} orch status --format json"
become: true
async: 30
poll: 1
2 changes: 1 addition & 1 deletion tests/roles/ceph_migrate/tasks/mon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
- name: reconfig osds
ansible.builtin.command: "{{ ceph_cli }} orch reconfig osd.default_drive_group "
- name: force-fail ceph mgr
ansible.builtin.command: "{{ ceph_cli }} mgr fail"
ansible.builtin.include_tasks: fail_mgr.yaml

- name: MON - Manage mons
# root privileges required to run cephadm
Expand Down

0 comments on commit 9d112bc

Please sign in to comment.