Newer
Older
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
-m find_disks
-a "partition_name='KOLLA_CEPH_DATA'"
register: osd_lookup
changed_when: "{{ osd_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
failed_when: osd_lookup.stdout.split()[2] != 'SUCCESS'
- name: Reading data from variable
set_fact:
osds: "{{ (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).disks|from_json }}"
- name: Mounting Ceph OSD volumes
mount:
src: "UUID={{ item.fs_uuid }}"
fstype: xfs
state: mounted
name: "/var/lib/ceph/osd/{{ item['fs_uuid'] }}"
with_items: osds
command: "cat /var/lib/ceph/osd/{{ item['fs_uuid'] }}/whoami"
with_items: osds
register: id
changed_when: False
failed_when: id.rc != 0
- name: Starting ceph-osd container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
environment:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
OSD_ID: "{{ item.0.stdout }}"
OSD_DEV: "{{ item.1['device'] }}"
- "{{ node_config_directory }}/ceph-osd/:{{ container_config_directory }}/:ro"
- "/var/lib/ceph/osd/{{ item.1['fs_uuid'] }}:/var/lib/ceph/osd/ceph-{{ item.0.stdout }}"