diff --git a/ansible/roles/blazar/defaults/main.yml b/ansible/roles/blazar/defaults/main.yml index 2ca63d5443..6cd6a69030 100644 --- a/ansible/roles/blazar/defaults/main.yml +++ b/ansible/roles/blazar/defaults/main.yml @@ -11,6 +11,7 @@ blazar_services: - "{{ node_config_directory }}/blazar-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/blazar/blazar:/var/lib/kolla/venv/lib/python2.7/site-packages/blazar' if blazar_dev_mode | bool else '' }}" blazar-manager: container_name: blazar_manager group: blazar-manager @@ -20,6 +21,8 @@ blazar_services: - "{{ node_config_directory }}/blazar-manager/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/blazar/blazar:/var/lib/kolla/venv/lib/python2.7/site-packages/blazar' if blazar_dev_mode | bool else '' }}" + #################### # Blazar @@ -61,3 +64,11 @@ blazar_logging_debug: "{{ openstack_logging_debug }}" blazar_keystone_user: "blazar" openstack_blazar_auth: "{{ openstack_auth }}" + + +##################### +## Kolla +##################### +blazar_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +blazar_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +blazar_dev_mode: "{{ kolla_dev_mode }}" diff --git a/ansible/roles/blazar/handlers/main.yml b/ansible/roles/blazar/handlers/main.yml index 67fa821796..64626bae09 100644 --- a/ansible/roles/blazar/handlers/main.yml +++ b/ansible/roles/blazar/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] diff --git a/ansible/roles/blazar/tasks/bootstrap_service.yml b/ansible/roles/blazar/tasks/bootstrap_service.yml index 74e07b1546..b59b8aed19 100644 --- a/ansible/roles/blazar/tasks/bootstrap_service.yml +++ b/ansible/roles/blazar/tasks/bootstrap_service.yml @@ -15,6 +15,6 @@ BOOTSTRAP: name: "bootstrap_blazar" restart_policy: "never" - volumes: "{{ blazar_api.volumes }}" + volumes: "{{ blazar_api.volumes|reject('equalto', '')|list }}" run_once: True delegate_to: "{{ groups[blazar_api.group][0] }}" diff --git a/ansible/roles/blazar/tasks/clone.yml b/ansible/roles/blazar/tasks/clone.yml new file mode 100644 index 0000000000..a107eefa58 --- /dev/null +++ b/ansible/roles/blazar/tasks/clone.yml @@ -0,0 +1,6 @@ +--- +- name: Cloning blazar source repository for development + git: + repo: "{{ blazar_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ blazar_dev_repos_pull }}" diff --git a/ansible/roles/blazar/tasks/config.yml b/ansible/roles/blazar/tasks/config.yml index dc7f5e1f2b..b12809959f 100644 --- a/ansible/roles/blazar/tasks/config.yml +++ b/ansible/roles/blazar/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_blazar_containers when: - kolla_action != "config" diff --git a/ansible/roles/blazar/tasks/deploy.yml b/ansible/roles/blazar/tasks/deploy.yml index 9cee66a9d8..fa2fb2ef2b 100644 --- a/ansible/roles/blazar/tasks/deploy.yml +++ b/ansible/roles/blazar/tasks/deploy.yml @@ -6,6 +6,9 @@ when: inventory_hostname in groups['blazar-api'] or inventory_hostname in groups['blazar-manager'] +- include: clone.yml + when: blazar_dev_mode | bool + - include: bootstrap.yml when: inventory_hostname in groups['blazar-api']