kolla-ansible/ansible/roles/cinder/tasks/external_ceph.yml
Duong Ha-Quang 9965cc46ff Specify 'become' for only neccesary tasks (all other roles)
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
2018-03-12 09:37:43 +07:00

82 lines
2.3 KiB
YAML

---
- name: Ensuring config directory exists
vars:
services_need_directory:
- "cinder-volume"
- "cinder-backup"
file:
path: "{{ node_config_directory }}/{{ item.key }}"
state: "directory"
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
become: true
when:
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
- item.key in services_need_directory
with_dict: "{{ cinder_services }}"
- name: Copying over ceph.conf for Cinder
vars:
services_need_config:
- "cinder-volume"
- "cinder-backup"
merge_configs:
sources:
- "{{ node_custom_config }}/cinder/ceph.conf"
- "{{ node_custom_config }}/cinder/{{ item.key }}/ceph.conf"
dest: "{{ node_config_directory }}/{{ item.key }}/ceph.conf"
mode: "0660"
become: true
when:
- item.value.enabled | bool
- inventory_hostname in groups[item.value.group]
- item.key in services_need_config
with_dict: "{{ cinder_services }}"
notify:
- Restart cinder-volume container
- Restart cinder-backup container
- name: Copy over Ceph keyring files for cinder-volume
copy:
src: "{{ item }}"
dest: "{{ node_config_directory }}/cinder-volume/"
mode: "0660"
become: true
with_fileglob:
- "{{ node_custom_config }}/cinder/cinder-volume/ceph.client*"
when:
- external_ceph_cephx_enabled | bool
- inventory_hostname in groups['cinder-volume']
- cinder_services['cinder-volume'].enabled | bool
notify:
- Restart cinder-volume container
- name: Copy over Ceph keyring files for cinder-backup
copy:
src: "{{ item }}"
dest: "{{ node_config_directory }}/cinder-backup/"
mode: "0660"
become: true
with_fileglob:
- "{{ node_custom_config }}/cinder/cinder-backup/ceph.client*"
when:
- external_ceph_cephx_enabled | bool
- inventory_hostname in groups['cinder-backup']
- cinder_services['cinder-backup'].enabled | bool
notify:
- Restart cinder-backup container
- name: Ensuring config directory has correct owner and permission
become: true
file:
path: "{{ node_config_directory }}/{{ item }}"
recurse: yes
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
when: inventory_hostname in groups[item]
with_items:
- "cinder-volume"
- "cinder-backup"