
Add become to only neccesary tasks in roles: - aodh - barbican - bifrost - ceilometer - ceph - chrony - cinder - cloudkitty - collectd - congress - designate - elasticsearch - etcd - freezer - gnocchi - grafana - influxdb - ironic - iscsi - karbor - kibana - kuryr - magnum - manila - mistral - mongodb - multipathd - murano - octavia - panko - qdrouterd - rally - sahara - searchlight - senlin - skydive - solum - swift - swift - tacker - telegraf - tempest - trove - vmtp - watcher - zun Change-Id: I6e32d94d4172dd96d09d8609e8a5221ab5586a31 Partial-Implements: blueprint ansible-specific-task-become
57 lines
1.9 KiB
YAML
57 lines
1.9 KiB
YAML
---
|
|
- name: Looking up OSDs for Ceph
|
|
command: docker exec -t kolla_toolbox sudo -E ansible localhost
|
|
-m find_disks
|
|
-a "partition_name='KOLLA_CEPH_DATA' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}"
|
|
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: Parsing disk info for Ceph OSDs
|
|
set_fact:
|
|
osds: "{{ (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).disks|from_json }}"
|
|
|
|
- name: Mounting Ceph OSD volumes
|
|
become: true
|
|
mount:
|
|
src: "UUID={{ item.fs_uuid }}"
|
|
fstype: "{{ ceph_osd_filesystem }}"
|
|
state: mounted
|
|
name: "/var/lib/ceph/osd/{{ item['fs_uuid'] }}"
|
|
opts: "{{ ceph_osd_mount_options }}"
|
|
with_items: "{{ osds }}"
|
|
become: true
|
|
become_method: sudo
|
|
|
|
- name: Gathering OSD IDs
|
|
become: true
|
|
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 }}"
|
|
JOURNAL_PARTITION: "{{ item.1.journal }}"
|
|
TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES: "{{ ceph_tcmalloc_tc_bytes }}"
|
|
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"
|
|
- "/etc/localtime:/etc/localtime:ro"
|
|
- "/dev/:/dev/"
|
|
- "/var/lib/ceph/osd/{{ item.1['fs_uuid'] }}:/var/lib/ceph/osd/ceph-{{ item.0.stdout }}"
|
|
- "kolla_logs:/var/log/kolla/"
|
|
with_together:
|
|
- "{{ id.results }}"
|
|
- "{{ osds }}"
|
|
when: osds
|