Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Seena Fallah <[email protected]>
  • Loading branch information
clwluvw committed Feb 18, 2024
1 parent 079c33c commit ffe9b2f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
6 changes: 3 additions & 3 deletions roles/ceph-crash/templates/ceph-crash.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-crash-%i \
{% if cluster != 'ceph' %}
-e CEPH_ARGS="--cluster {{ cluster }}" \
{% endif %}
{% for v in ceph_common_container_params['volumes'] %}
-v {{ v }} \
{% endfor %}
-v /var/lib/ceph/crash:/var/lib/ceph/crash:z \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/ceph:/etc/ceph:z \
{% for k, v in ceph_common_container_params['envs'].items() %}
-e {{ k }}={{ v }} \
{% endfor %}
Expand Down
49 changes: 34 additions & 15 deletions roles/ceph-mon/tasks/ceph_keys.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
---
- name: Waiting for the monitor(s) to form the quorum...
ansible.builtin.command: >
{{ container_exec_cmd }}
ceph
--cluster {{ cluster }}
daemon mon.{{ ansible_facts['hostname'] }}
mon_status
--format json
register: ceph_health_raw
run_once: true
until: >
(ceph_health_raw.stdout | length > 0) and (ceph_health_raw.stdout | default('{}') | from_json)['state'] in ['leader', 'peon']
retries: "{{ handler_health_mon_check_retries }}"
delay: "{{ handler_health_mon_check_delay }}"
changed_when: false
when: not ansible_check_mode
block:
- name: Wait for the monitor(s) to form the quorum
ansible.builtin.command: >
{{ container_exec_cmd }}
ceph
--cluster {{ cluster }}
daemon mon.{{ ansible_facts['hostname'] }}
mon_status
--format json
register: ceph_health_raw
run_once: true
until: >
(ceph_health_raw.stdout | length > 0) and (ceph_health_raw.stdout | default('{}') | from_json)['state'] in ['leader', 'peon']
retries: "{{ handler_health_mon_check_retries }}"
delay: "{{ handler_health_mon_check_delay }}"
changed_when: false
when: not ansible_check_mode
rescue:
- name: List run dir
ansible.builtin.command: ls -lah /var/run/ceph
changed_when: false
- name: List run dir inside container
ansible.builtin.command: "{{ container_exec_cmd }} ls -lah /var/run/ceph"
changed_when: false
- name: Ceph status
ansible.builtin.command: >
{{ container_exec_cmd }}
ceph
--cluster {{ cluster }}
-s
changed_when: false
- name: Fail the task
ansible.builtin.fail:
msg: "Monitor(s) failed to form the quorum"

- name: Fetch ceph initial keys
ceph_key:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ commands=
all_daemons,all_daemons_ipv6,collocation: py.test --reruns 20 --reruns-delay 3 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests

# handlers/idempotency test
all_daemons,all_daemon_ipv6,all_in_one,collocation: ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "delegate_facts_host={env:DELEGATE_FACTS_HOST:True} ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG_BIS:latest-bis-main} ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} yes_i_know=true" --extra-vars @ceph-override.json
all_daemons,all_daemon_ipv6,all_in_one,collocation: ansible-playbook -vv --diff -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "no_log_on_ceph_key_tasks=false delegate_facts_host={env:DELEGATE_FACTS_HOST:True} ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG_BIS:latest-bis-main} ceph_dev_branch={env:CEPH_DEV_BRANCH:main} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} yes_i_know=true" --extra-vars @ceph-override.json

purge: {[purge]commands}
purge_dashboard: {[purge-dashboard]commands}
Expand Down

0 comments on commit ffe9b2f

Please sign in to comment.