dev mode: Add support for blazar

Provide support for kolla dev mode in blazar. When
'kolla_dev_mode' or 'blazar_dev_mode' variables are
enabled, source code of blazar project will be  cloned
and mounted automatically

Partially implements: blueprint mount-sources

Change-Id: I50c5eb97be1123b76b1d42fbb25a0ecbaa2c1a44
This commit is contained in:
wu.chunyang 2018-06-26 02:53:41 +00:00
parent ab5fd56bb0
commit 8da9379269
6 changed files with 24 additions and 4 deletions

View File

@ -11,6 +11,7 @@ blazar_services:
- "{{ node_config_directory }}/blazar-api/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/blazar/blazar:/var/lib/kolla/venv/lib/python2.7/site-packages/blazar' if blazar_dev_mode | bool else '' }}"
blazar-manager:
container_name: blazar_manager
group: blazar-manager
@ -20,6 +21,8 @@ blazar_services:
- "{{ node_config_directory }}/blazar-manager/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/blazar/blazar:/var/lib/kolla/venv/lib/python2.7/site-packages/blazar' if blazar_dev_mode | bool else '' }}"
####################
# Blazar
@ -61,3 +64,11 @@ blazar_logging_debug: "{{ openstack_logging_debug }}"
blazar_keystone_user: "blazar"
openstack_blazar_auth: "{{ openstack_auth }}"
#####################
## Kolla
#####################
blazar_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
blazar_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
blazar_dev_mode: "{{ kolla_dev_mode }}"

View File

@ -13,7 +13,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -37,7 +37,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

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

View File

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

View File

@ -88,7 +88,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
register: check_blazar_containers
when:
- kolla_action != "config"

View File

@ -6,6 +6,9 @@
when: inventory_hostname in groups['blazar-api'] or
inventory_hostname in groups['blazar-manager']
- include: clone.yml
when: blazar_dev_mode | bool
- include: bootstrap.yml
when: inventory_hostname in groups['blazar-api']