diff --git a/ansible/roles/congress/defaults/main.yml b/ansible/roles/congress/defaults/main.yml index 4d2bac2e92..63ba5e03ca 100644 --- a/ansible/roles/congress/defaults/main.yml +++ b/ansible/roles/congress/defaults/main.yml @@ -11,6 +11,7 @@ congress_services: - "{{ node_config_directory }}/congress-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/congress/congress:/var/lib/kolla/venv/lib/python2.7/site-packages/congress' if congress_dev_mode | bool else '' }}" congress-policy-engine: container_name: congress_policy_engine group: congress-policy-engine @@ -20,6 +21,7 @@ congress_services: - "{{ node_config_directory }}/congress-policy-engine/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/congress/congress:/var/lib/kolla/venv/lib/python2.7/site-packages/congress' if congress_dev_mode | bool else '' }}" congress-datasource: container_name: congress_datasource group: congress-datasource @@ -29,6 +31,7 @@ congress_services: - "{{ node_config_directory }}/congress-datasource/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/congress/congress:/var/lib/kolla/venv/lib/python2.7/site-packages/congress' if congress_dev_mode | bool else '' }}" #################### @@ -70,3 +73,11 @@ congress_logging_debug: "{{ openstack_logging_debug }}" congress_keystone_user: "congress" openstack_congress_auth: "{{ openstack_auth }}" + + +#################### +# Kolla +#################### +congress_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +congress_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +congress_dev_mode: "{{ kolla_dev_mode }}" diff --git a/ansible/roles/congress/handlers/main.yml b/ansible/roles/congress/handlers/main.yml index 8b539cfcb5..d065d2521e 100644 --- a/ansible/roles/congress/handlers/main.yml +++ b/ansible/roles/congress/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/congress/tasks/bootstrap_service.yml b/ansible/roles/congress/tasks/bootstrap_service.yml index ca498c6201..85fcb131c4 100644 --- a/ansible/roles/congress/tasks/bootstrap_service.yml +++ b/ansible/roles/congress/tasks/bootstrap_service.yml @@ -15,6 +15,6 @@ BOOTSTRAP: name: "bootstrap_congress" restart_policy: "never" - volumes: "{{ congress_api.volumes }}" + volumes: "{{ congress_api.volumes|reject('equalto', '')|list }}" run_once: True delegate_to: "{{ groups[congress_api.group][0] }}" diff --git a/ansible/roles/congress/tasks/clone.yml b/ansible/roles/congress/tasks/clone.yml new file mode 100644 index 0000000000..6942bd3f4b --- /dev/null +++ b/ansible/roles/congress/tasks/clone.yml @@ -0,0 +1,6 @@ +--- +- name: Cloning congress source repository for development + git: + repo: "{{ congress_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ congress_dev_repos_pull }}" diff --git a/ansible/roles/congress/tasks/config.yml b/ansible/roles/congress/tasks/config.yml index f60f1f9f34..75fcffa090 100644 --- a/ansible/roles/congress/tasks/config.yml +++ b/ansible/roles/congress/tasks/config.yml @@ -84,7 +84,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_congress_containers when: - kolla_action != "config" diff --git a/ansible/roles/congress/tasks/deploy.yml b/ansible/roles/congress/tasks/deploy.yml index 1bf2c2a94b..e7b57aca8f 100644 --- a/ansible/roles/congress/tasks/deploy.yml +++ b/ansible/roles/congress/tasks/deploy.yml @@ -7,6 +7,9 @@ inventory_hostname in groups['congress-policy-engine'] or inventory_hostname in groups['congress-datasource'] +- include: clone.yml + when: congress_dev_mode | bool + - include: bootstrap.yml when: inventory_hostname in groups['congress-api']