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:
parent
29a6a61d97
commit
59a0ddcd01
@ -11,6 +11,7 @@ designate_services:
|
|||||||
- "{{ node_config_directory }}/designate-api/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/designate-api/:{{ container_config_directory }}/:ro"
|
||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "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:
|
designate-backend-bind9:
|
||||||
container_name: designate_backend_bind9
|
container_name: designate_backend_bind9
|
||||||
group: designate-backend-bind9
|
group: designate-backend-bind9
|
||||||
@ -30,6 +31,7 @@ designate_services:
|
|||||||
- "{{ node_config_directory }}/designate-central/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/designate-central/:{{ container_config_directory }}/:ro"
|
||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "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:
|
designate-mdns:
|
||||||
container_name: designate_mdns
|
container_name: designate_mdns
|
||||||
group: designate-mdns
|
group: designate-mdns
|
||||||
@ -39,6 +41,7 @@ designate_services:
|
|||||||
- "{{ node_config_directory }}/designate-mdns/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/designate-mdns/:{{ container_config_directory }}/:ro"
|
||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "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:
|
designate-producer:
|
||||||
container_name: designate_producer
|
container_name: designate_producer
|
||||||
group: designate-producer
|
group: designate-producer
|
||||||
@ -48,6 +51,7 @@ designate_services:
|
|||||||
- "{{ node_config_directory }}/designate-producer/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/designate-producer/:{{ container_config_directory }}/:ro"
|
||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "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:
|
designate-worker:
|
||||||
container_name: designate_worker
|
container_name: designate_worker
|
||||||
group: designate-worker
|
group: designate-worker
|
||||||
@ -57,6 +61,7 @@ designate_services:
|
|||||||
- "{{ node_config_directory }}/designate-worker/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/designate-worker/:{{ container_config_directory }}/:ro"
|
||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "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:
|
designate-sink:
|
||||||
container_name: designate_sink
|
container_name: designate_sink
|
||||||
group: designate-sink
|
group: designate-sink
|
||||||
@ -66,6 +71,7 @@ designate_services:
|
|||||||
- "{{ node_config_directory }}/designate-sink/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/designate-sink/:{{ container_config_directory }}/:ro"
|
||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "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"
|
designate_keystone_user: "designate"
|
||||||
|
|
||||||
openstack_designate_auth: "{{ openstack_auth }}"
|
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 }}"
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ service.container_name }}"
|
name: "{{ service.container_name }}"
|
||||||
image: "{{ service.image }}"
|
image: "{{ service.image }}"
|
||||||
volumes: "{{ service.volumes }}"
|
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- inventory_hostname in groups[service.group]
|
- inventory_hostname in groups[service.group]
|
||||||
@ -36,7 +36,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ service.container_name }}"
|
name: "{{ service.container_name }}"
|
||||||
image: "{{ service.image }}"
|
image: "{{ service.image }}"
|
||||||
volumes: "{{ service.volumes }}"
|
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- inventory_hostname in groups[service.group]
|
- inventory_hostname in groups[service.group]
|
||||||
@ -60,7 +60,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ service.container_name }}"
|
name: "{{ service.container_name }}"
|
||||||
image: "{{ service.image }}"
|
image: "{{ service.image }}"
|
||||||
volumes: "{{ service.volumes }}"
|
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- inventory_hostname in groups[service.group]
|
- inventory_hostname in groups[service.group]
|
||||||
@ -84,7 +84,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ service.container_name }}"
|
name: "{{ service.container_name }}"
|
||||||
image: "{{ service.image }}"
|
image: "{{ service.image }}"
|
||||||
volumes: "{{ service.volumes }}"
|
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- inventory_hostname in groups[service.group]
|
- inventory_hostname in groups[service.group]
|
||||||
@ -108,7 +108,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ service.container_name }}"
|
name: "{{ service.container_name }}"
|
||||||
image: "{{ service.image }}"
|
image: "{{ service.image }}"
|
||||||
volumes: "{{ service.volumes }}"
|
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- inventory_hostname in groups[service.group]
|
- inventory_hostname in groups[service.group]
|
||||||
@ -132,7 +132,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ service.container_name }}"
|
name: "{{ service.container_name }}"
|
||||||
image: "{{ service.image }}"
|
image: "{{ service.image }}"
|
||||||
volumes: "{{ service.volumes }}"
|
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- inventory_hostname in groups[service.group]
|
- inventory_hostname in groups[service.group]
|
||||||
@ -158,7 +158,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ service.container_name }}"
|
name: "{{ service.container_name }}"
|
||||||
image: "{{ service.image }}"
|
image: "{{ service.image }}"
|
||||||
volumes: "{{ service.volumes }}"
|
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- inventory_hostname in groups[service.group]
|
- inventory_hostname in groups[service.group]
|
||||||
|
@ -15,6 +15,6 @@
|
|||||||
BOOTSTRAP:
|
BOOTSTRAP:
|
||||||
name: "bootstrap_designate"
|
name: "bootstrap_designate"
|
||||||
restart_policy: "never"
|
restart_policy: "never"
|
||||||
volumes: "{{ designate_central.volumes }}"
|
volumes: "{{ designate_central.volumes|reject('equalto', '')|list }}"
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups[designate_central.group][0] }}"
|
delegate_to: "{{ groups[designate_central.group][0] }}"
|
||||||
|
6
ansible/roles/designate/tasks/clone.yml
Normal file
6
ansible/roles/designate/tasks/clone.yml
Normal 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 }}"
|
@ -183,7 +183,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ item.value.container_name }}"
|
name: "{{ item.value.container_name }}"
|
||||||
image: "{{ item.value.image }}"
|
image: "{{ item.value.image }}"
|
||||||
volumes: "{{ item.value.volumes }}"
|
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
|
||||||
register: check_designate_containers
|
register: check_designate_containers
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
inventory_hostname in groups['designate-sink'] or
|
inventory_hostname in groups['designate-sink'] or
|
||||||
inventory_hostname in groups['designate-backend-bind9']
|
inventory_hostname in groups['designate-backend-bind9']
|
||||||
|
|
||||||
|
- include: clone.yml
|
||||||
|
when: designate_dev_mode | bool
|
||||||
|
|
||||||
- include: bootstrap.yml
|
- include: bootstrap.yml
|
||||||
when: inventory_hostname in groups['designate-central']
|
when: inventory_hostname in groups['designate-central']
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user