kolla-ansible/ansible/roles/iscsi/tasks/config.yml
Duong Ha-Quang d0cac653eb Check enable_cinder before deploy iscsi and tgtd
Add check enable_cinder to iscsi and tgtd deploy logic.

The ironic check is not effected.

Change-Id: If14ae52fbacf106b112e40a813ad6143cb095edc
Closes-Bug: #1742873
2018-01-15 03:47:00 +00:00

41 lines
1.4 KiB
YAML

---
- name: Ensuring config directories exist
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
recurse: yes
when: ( ( inventory_hostname in groups['compute'] or inventory_hostname in groups['cinder-volume'] ) and enable_cinder | bool and enable_cinder_backend_iscsi | bool )
or ( inventory_hostname in groups['ironic-conductor'] and enable_ironic | bool )
with_items:
- "iscsid"
- name: Copying over config.json files for services
template:
src: "{{ item }}.json.j2"
dest: "{{ node_config_directory }}/{{ item }}/config.json"
when: ( ( inventory_hostname in groups['compute'] or inventory_hostname in groups['cinder-volume'] ) and enable_cinder | bool and enable_cinder_backend_iscsi | bool )
or ( inventory_hostname in groups['ironic-conductor'] and enable_ironic | bool )
with_items:
- "iscsid"
- name: Ensuring config directories exist
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
recurse: yes
when:
- enable_cinder_backend_lvm | bool
- inventory_hostname in groups['tgtd']
with_items:
- "tgtd"
- name: Copying over config.json files for services
template:
src: "{{ item }}.json.j2"
dest: "{{ node_config_directory }}/{{ item }}/config.json"
when:
- enable_cinder_backend_lvm | bool
- inventory_hostname in groups['tgtd']
with_items:
- "tgtd"