- name: stop ceph mgrs with systemd
service:
- name: ceph-mgr@{{ ansible_hostname}}
+ name: ceph-mgr@{{ ansible_hostname }}
state: stopped
enabled: no
failed_when: false
- name: stop ceph-osd with systemd
service:
- name: ceph-osd@{{item}}
+ name: ceph-osd@{{ item }}
state: stopped
enabled: no
with_items: "{{ osd_ids.stdout_lines }}"
- iscsigws
become: yes
vars:
- - igw_purge_type: "{{hostvars['localhost']['igw_purge_type']}}"
+ - igw_purge_type: "{{ hostvars['localhost']['igw_purge_type'] }}"
tasks:
- name: stopping and disabling iscsi daemons
- name: get total number of mgrs in cluster
block:
- name: save mgr dump output
- command: "{{ container_exec_cmd | default('') }} ceph --cluster {{cluster}} mgr dump -f json"
+ command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} mgr dump -f json"
register: mgr_dump
- name: get active and standbys mgr list
- name: add pkname information in ceph_osd_data_json
set_fact:
- ceph_osd_data_json: "{{ ceph_osd_data_json | default({}) | combine({item.item[2]: {'pkname_data': '/dev/' + item.stdout}}, recursive=True) }}"
+ ceph_osd_data_json: "{{ ceph_osd_data_json | default({}) | combine({item.item[2]: {'pkname_data': '/dev/' + item.stdout }}, recursive=True) }}"
loop: "{{ parent_device_data_part.results }}"
when: item.skipped is undefined
delegate_to: "{{ rgw_host }}"
post_tasks:
- name: show ceph health
- command: "{{ container_exec_cmd | default('')}} ceph --cluster {{ cluster }} -s"
+ command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} -s"
changed_when: false
command: "systemctl disable --runtime {{ item }}"
changed_when: false
failed_when: false
- with_items: "{{ running_osds.stdout_lines | default([])}}"
+ with_items: "{{ running_osds.stdout_lines | default([]) }}"
when: item.startswith('ceph-osd@')
- name: stop/disable/mask non-containerized ceph osd(s) (if any)
name: "{{ item }}"
state: stopped
enabled: no
- with_items: "{{ running_osds.stdout_lines | default([])}}"
+ with_items: "{{ running_osds.stdout_lines | default([]) }}"
when: running_osds != []
- name: remove old ceph-osd systemd units