dev mode: Add support for designate

Provide support for kolla dev mode in designate. When
'kolla_dev_mode' or 'designate_dev_mode' variables are
enabled, source code of designate project is cloned
and bindmounted.

Partially implements: blueprint mount-sources
Co-Authored-By: zhulingjie <easyzlj@gmail.com>

Change-Id: Ib23fbd3d5ebc7e3ac372e0db1e0048d333eb95c0
This commit is contained in:
caoyuan 2018-04-13 00:21:21 +08:00
parent 29a6a61d97
commit 59a0ddcd01
6 changed files with 32 additions and 9 deletions

View File

@ -11,6 +11,7 @@ designate_services:
- "{{ node_config_directory }}/designate-api/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
designate-backend-bind9:
container_name: designate_backend_bind9
group: designate-backend-bind9
@ -30,6 +31,7 @@ designate_services:
- "{{ node_config_directory }}/designate-central/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
designate-mdns:
container_name: designate_mdns
group: designate-mdns
@ -39,6 +41,7 @@ designate_services:
- "{{ node_config_directory }}/designate-mdns/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
designate-producer:
container_name: designate_producer
group: designate-producer
@ -48,6 +51,7 @@ designate_services:
- "{{ node_config_directory }}/designate-producer/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
designate-worker:
container_name: designate_worker
group: designate-worker
@ -57,6 +61,7 @@ designate_services:
- "{{ node_config_directory }}/designate-worker/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
designate-sink:
container_name: designate_sink
group: designate-sink
@ -66,6 +71,7 @@ designate_services:
- "{{ node_config_directory }}/designate-sink/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/designate/designate:/var/lib/kolla/venv/lib/python2.7/site-packages/designate' if designate_dev_mode | bool else '' }}"
####################
@ -126,3 +132,11 @@ designate_logging_debug: "{{ openstack_logging_debug }}"
designate_keystone_user: "designate"
openstack_designate_auth: "{{ openstack_auth }}"
####################
# Kolla
####################
designate_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
designate_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
designate_dev_mode: "{{ kolla_dev_mode }}"

View File

@ -11,7 +11,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]
@ -36,7 +36,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]
@ -60,7 +60,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]
@ -84,7 +84,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]
@ -108,7 +108,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]
@ -132,7 +132,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]
@ -158,7 +158,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_designate"
restart_policy: "never"
volumes: "{{ designate_central.volumes }}"
volumes: "{{ designate_central.volumes|reject('equalto', '')|list }}"
run_once: True
delegate_to: "{{ groups[designate_central.group][0] }}"

View File

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

View File

@ -183,7 +183,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_designate_containers
when:
- kolla_action != "config"

View File

@ -11,6 +11,9 @@
inventory_hostname in groups['designate-sink'] or
inventory_hostname in groups['designate-backend-bind9']
- include: clone.yml
when: designate_dev_mode | bool
- include: bootstrap.yml
when: inventory_hostname in groups['designate-central']