dev mode: Add support for cinder

Provide support for kolla dev mode in cinder. When
'kolla_dev_mode' or 'cinder_dev_mode' variables are
enabled, source code of cinder project is cloned
and bind mounted.

Partially implements: blueprint mount-sources

Change-Id: I9ccd395d076f9cc1ad4b51af9d22ba8b17fac1bc
This commit is contained in:
caoyuan 2018-04-13 21:10:10 +08:00
parent be693c3518
commit c8bb9bcc2b
4 changed files with 22 additions and 1 deletions

View File

@ -11,6 +11,7 @@ cinder_services:
- "{{ node_config_directory }}/cinder-api/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
cinder-scheduler:
container_name: cinder_scheduler
group: cinder-scheduler
@ -20,6 +21,7 @@ cinder_services:
- "{{ node_config_directory }}/cinder-scheduler/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
cinder-volume:
container_name: cinder_volume
group: cinder-volume
@ -36,6 +38,7 @@ cinder_services:
- "cinder:/var/lib/cinder"
- "{% if enable_iscsid | bool %}iscsi_info:/etc/iscsi{% endif %}"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
cinder-backup:
container_name: cinder_backup
group: cinder-backup
@ -50,6 +53,7 @@ cinder_services:
- "cinder:/var/lib/cinder"
- "{% if enable_iscsid | bool %}iscsi_info:/etc/iscsi{% endif %}"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/cinder/cinder:/var/lib/kolla/venv/lib/python2.7/site-packages/cinder' if cinder_dev_mode | bool else '' }}"
####################
# Ceph
@ -179,3 +183,11 @@ zfssa_iscsi_project:
zfssa_iscsi_initiator_group:
zfssa_iscsi_target_portal:
zfssa_iscsi_target_interfaces:
####################
# Kolla
####################
cinder_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
cinder_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
cinder_dev_mode: "{{ kolla_dev_mode }}"

View File

@ -15,6 +15,6 @@
BOOTSTRAP:
name: "bootstrap_cinder"
restart_policy: "never"
volumes: "{{ cinder_api.volumes }}"
volumes: "{{ cinder_api.volumes|reject('equalto', '')|list }}"
run_once: True
delegate_to: "{{ groups[cinder_api.group][0] }}"

View File

@ -0,0 +1,6 @@
---
- name: Cloning cinder source repository for development
git:
repo: "{{ cinder_git_repository }}"
dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}"
update: "{{ cinder_dev_repos_pull }}"

View File

@ -23,6 +23,9 @@
inventory_hostname in groups['cinder-scheduler'] or
inventory_hostname in groups['cinder-backup']
- include: clone.yml
when: cinder_dev_mode | bool
- include: bootstrap.yml
when: inventory_hostname in groups['cinder-api']