diff --git a/ansible/roles/watcher/defaults/main.yml b/ansible/roles/watcher/defaults/main.yml index 854afe1bae..b5eafe6221 100644 --- a/ansible/roles/watcher/defaults/main.yml +++ b/ansible/roles/watcher/defaults/main.yml @@ -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 }}" diff --git a/ansible/roles/watcher/handlers/main.yml b/ansible/roles/watcher/handlers/main.yml index 3ae4379b5e..4fd9e4b0db 100644 --- a/ansible/roles/watcher/handlers/main.yml +++ b/ansible/roles/watcher/handlers/main.yml @@ -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] diff --git a/ansible/roles/watcher/tasks/bootstrap_service.yml b/ansible/roles/watcher/tasks/bootstrap_service.yml index 7e419de3ba..089e9f2dc4 100644 --- a/ansible/roles/watcher/tasks/bootstrap_service.yml +++ b/ansible/roles/watcher/tasks/bootstrap_service.yml @@ -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] }}" diff --git a/ansible/roles/watcher/tasks/clone.yml b/ansible/roles/watcher/tasks/clone.yml new file mode 100644 index 0000000000..47c1b86be0 --- /dev/null +++ b/ansible/roles/watcher/tasks/clone.yml @@ -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 }}" diff --git a/ansible/roles/watcher/tasks/config.yml b/ansible/roles/watcher/tasks/config.yml index aa2e09fe3a..775e3840de 100644 --- a/ansible/roles/watcher/tasks/config.yml +++ b/ansible/roles/watcher/tasks/config.yml @@ -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" diff --git a/ansible/roles/watcher/tasks/deploy.yml b/ansible/roles/watcher/tasks/deploy.yml index 2b77abf57e..3383b08d5f 100644 --- a/ansible/roles/watcher/tasks/deploy.yml +++ b/ansible/roles/watcher/tasks/deploy.yml @@ -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']