Merge "dev mode: Add support for Watcher"

This commit is contained in:
Zuul 2018-06-19 03:32:09 +00:00 committed by Gerrit Code Review
commit 29a6a61d97
6 changed files with 25 additions and 5 deletions

View File

@ -10,6 +10,7 @@ watcher_services:
volumes:
- "{{ node_config_directory }}/watcher-api/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ kolla_dev_repos_directory ~ '/watcher/watcher:/var/lib/kolla/venv/lib/python2.7/site-packages/watcher' if watcher_dev_mode | bool else '' }}"
- "kolla_logs:/var/log/kolla/"
watcher-applier:
container_name: watcher_applier
@ -19,6 +20,7 @@ watcher_services:
volumes:
- "{{ node_config_directory }}/watcher-applier/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ kolla_dev_repos_directory ~ '/watcher/watcher:/var/lib/kolla/venv/lib/python2.7/site-packages/watcher' if watcher_dev_mode | bool else '' }}"
- "kolla_logs:/var/log/kolla/"
watcher-engine:
container_name: watcher_engine
@ -28,6 +30,7 @@ watcher_services:
volumes:
- "{{ node_config_directory }}/watcher-engine/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ kolla_dev_repos_directory ~ '/watcher/watcher:/var/lib/kolla/venv/lib/python2.7/site-packages/watcher' if watcher_dev_mode | bool else '' }}"
- "kolla_logs:/var/log/kolla/"
@ -69,3 +72,11 @@ watcher_logging_debug: "{{ openstack_logging_debug }}"
watcher_keystone_user: "watcher"
openstack_watcher_auth: "{{ openstack_auth }}"
####################
# Kolla
####################
watcher_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
watcher_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
watcher_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]
@ -61,7 +61,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_watcher"
restart_policy: "never"
volumes: "{{ watcher_api.volumes }}"
volumes: "{{ watcher_api.volumes|reject('equalto', '')|list }}"
run_once: True
delegate_to: "{{ groups[watcher_api.group][0] }}"

View File

@ -0,0 +1,6 @@
---
- name: Cloning watcher source repository for development
git:
repo: "{{ watcher_git_repository }}"
dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}"
update: "{{ watcher_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_watcher_containers
when:
- kolla_action != "config"

View File

@ -7,6 +7,9 @@
inventory_hostname in groups['watcher-engine'] or
inventory_hostname in groups['watcher-applier']
- include: clone.yml
when: watcher_dev_mode | bool
- include: bootstrap.yml
when: inventory_hostname in groups['watcher-api']