mirror of https://github.com/ceph/ceph-ansible.git
remove this detection and simply rely on {{ cluster }}
parent
3d10c5981e
commit
62c37042fe
|
@ -27,7 +27,7 @@
|
||||||
# @param partitions: The custom partition layout of new ssd
|
# @param partitions: The custom partition layout of new ssd
|
||||||
# @param index: The index of this partition
|
# @param index: The index of this partition
|
||||||
# @param size: The size of this partition
|
# @param size: The size of this partition
|
||||||
# @param osd_id: Which osds's journal this parttition for.
|
# @param osd_id: Which osds's journal this partition for.
|
||||||
#
|
#
|
||||||
# ansible-playbook recover-osds-after-ssd-journal-failure.yml
|
# ansible-playbook recover-osds-after-ssd-journal-failure.yml
|
||||||
# Prompts for select which host to recover, defaults to null,
|
# Prompts for select which host to recover, defaults to null,
|
||||||
|
@ -58,16 +58,10 @@
|
||||||
tasks:
|
tasks:
|
||||||
- fail: msg="please define dev_ssds variable"
|
- fail: msg="please define dev_ssds variable"
|
||||||
when: dev_ssds|length <= 0
|
when: dev_ssds|length <= 0
|
||||||
|
|
||||||
- name: get the name of the existing ceph cluster
|
|
||||||
shell: |
|
|
||||||
basename $(grep -R fsid /etc/ceph/ | egrep -o '^[^.]*')
|
|
||||||
changed_when: false
|
|
||||||
register: cluster_name
|
|
||||||
|
|
||||||
- name: get osd(s) if directory stat
|
- name: get osd(s) if directory stat
|
||||||
stat:
|
stat:
|
||||||
path: "/var/lib/ceph/osd/{{ cluster_name.stdout }}-{{ item.1.osd_id }}/journal_uuid"
|
path: "/var/lib/ceph/osd/{{ cluster }}-{{ item.1.osd_id }}/journal_uuid"
|
||||||
register: osds_dir_stat
|
register: osds_dir_stat
|
||||||
with_subelements:
|
with_subelements:
|
||||||
- "{{ dev_ssds }}"
|
- "{{ dev_ssds }}"
|
||||||
|
@ -88,7 +82,7 @@
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: get osd(s) journal uuid
|
- name: get osd(s) journal uuid
|
||||||
shell: cat "/var/lib/ceph/osd/{{ cluster_name.stdout }}-{{ item.1.osd_id }}/journal_uuid"
|
shell: cat "/var/lib/ceph/osd/{{ cluster }}-{{ item.1.osd_id }}/journal_uuid"
|
||||||
register: osds_uuid
|
register: osds_uuid
|
||||||
with_subelements:
|
with_subelements:
|
||||||
- "{{ dev_ssds }}"
|
- "{{ dev_ssds }}"
|
||||||
|
@ -110,10 +104,9 @@
|
||||||
|
|
||||||
- name: reinitialize osd(s) journal in new ssd
|
- name: reinitialize osd(s) journal in new ssd
|
||||||
shell: >
|
shell: >
|
||||||
ceph-osd -i {{ item.item[1].osd_id }} --mkjournal --cluster {{ cluster_name.stdout }}
|
ceph-osd -i {{ item.item[1].osd_id }} --mkjournal --cluster {{ cluster }}
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ osds_uuid.results }}"
|
- "{{ osds_uuid.results }}"
|
||||||
when: cluster_name is defined
|
|
||||||
|
|
||||||
- name: start osd(s) service
|
- name: start osd(s) service
|
||||||
service:
|
service:
|
||||||
|
|
Loading…
Reference in New Issue