![SamYaple](/assets/img/avatar_default.png)
This change is needed for clarity. We have a kolla-ansible script. We have a kolla-mesos repo. We plan to have a kolla-ansible repo. Already we have had far too much confusion about whether we are talking about the container or the project. Naming this kolla-toolbox eliminates all of that confusion and its probably a bit more accurate of a name too. Closes-Bug: #1541053 Change-Id: I8fd1f49d5a22b36ede5b10f46b9fe02ddda9007e
51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
---
|
|
- name: Looking up OSDs for Ceph
|
|
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
|
|
|
|
- name: Gathering OSD IDs
|
|
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'] }}"
|
|
image: "{{ ceph_osd_image_full }}"
|
|
name: "ceph_osd_{{ item.0.stdout }}"
|
|
pid_mode: "host"
|
|
privileged: True
|
|
volumes:
|
|
- "{{ node_config_directory }}/ceph-osd/:{{ container_config_directory }}/:ro"
|
|
- "/dev/:/dev/"
|
|
- "/var/lib/ceph/osd/{{ item.1['fs_uuid'] }}:/var/lib/ceph/osd/ceph-{{ item.0.stdout }}"
|
|
with_together:
|
|
- id.results
|
|
- osds
|
|
when:
|
|
- inventory_hostname in groups['ceph-osd']
|
|
- osds
|