diff --git a/ansible/roles/magnum/defaults/main.yml b/ansible/roles/magnum/defaults/main.yml index 0b717aa884..6a24bb0341 100644 --- a/ansible/roles/magnum/defaults/main.yml +++ b/ansible/roles/magnum/defaults/main.yml @@ -12,6 +12,7 @@ magnum_services: volumes: - "{{ node_config_directory }}/magnum-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" + - "{{ kolla_dev_repos_directory ~ '/magnum/magnum:/var/lib/kolla/venv/lib/python2.7/site-packages/magnum' if magnum_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" magnum-conductor: container_name: magnum_conductor @@ -23,6 +24,7 @@ magnum_services: - "{{ node_config_directory }}/magnum-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "magnum:/var/lib/magnum/" + - "{{ kolla_dev_repos_directory ~ '/magnum/magnum:/var/lib/kolla/venv/lib/python2.7/site-packages/magnum' if magnum_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" @@ -69,3 +71,11 @@ magnum_trustee_domain_admin: "magnum_trustee_domain_admin" magnum_trustee_domain: "magnum" openstack_magnum_auth: "{{ openstack_auth }}" + + +#################### +# Kolla +#################### +magnum_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +magnum_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +magnum_dev_mode: "{{ kolla_dev_mode }}" diff --git a/ansible/roles/magnum/handlers/main.yml b/ansible/roles/magnum/handlers/main.yml index 79430d023c..301f1346b0 100644 --- a/ansible/roles/magnum/handlers/main.yml +++ b/ansible/roles/magnum/handlers/main.yml @@ -12,7 +12,7 @@ common_options: "{{ docker_common_options }}" name: "{{ service.container_name }}" image: "{{ service.image }}" - volumes: "{{ service.volumes }}" + volumes: "{{ service.volumes|reject('equalto', '')|list }}" environment: "{{ service.environment }}" when: - action != "config" @@ -36,7 +36,7 @@ common_options: "{{ docker_common_options }}" name: "{{ service.container_name }}" image: "{{ service.image }}" - volumes: "{{ service.volumes }}" + volumes: "{{ service.volumes|reject('equalto', '')|list }}" environment: "{{ service.environment }}" when: - action != "config" diff --git a/ansible/roles/magnum/tasks/bootstrap_service.yml b/ansible/roles/magnum/tasks/bootstrap_service.yml index 6cb9122df6..f7d796f754 100644 --- a/ansible/roles/magnum/tasks/bootstrap_service.yml +++ b/ansible/roles/magnum/tasks/bootstrap_service.yml @@ -14,6 +14,6 @@ BOOTSTRAP: name: "bootstrap_magnum" restart_policy: "never" - volumes: "{{ magnum_api.volumes }}" + volumes: "{{ magnum_api.volumes|reject('equalto', '')|list }}" run_once: True delegate_to: "{{ groups[magnum_api.group][0] }}" diff --git a/ansible/roles/magnum/tasks/clone.yml b/ansible/roles/magnum/tasks/clone.yml new file mode 100644 index 0000000000..f98b8836e8 --- /dev/null +++ b/ansible/roles/magnum/tasks/clone.yml @@ -0,0 +1,6 @@ +--- +- name: Cloning magnum source repository for development + git: + repo: "{{ magnum_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ magnum_dev_repos_pull }}" diff --git a/ansible/roles/magnum/tasks/config.yml b/ansible/roles/magnum/tasks/config.yml index 5571eb5094..400caf4808 100644 --- a/ansible/roles/magnum/tasks/config.yml +++ b/ansible/roles/magnum/tasks/config.yml @@ -67,7 +67,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 }}" environment: "{{ item.value.environment }}" register: check_magnum_containers when: diff --git a/ansible/roles/magnum/tasks/deploy.yml b/ansible/roles/magnum/tasks/deploy.yml index 68d5007e8e..5485c84433 100644 --- a/ansible/roles/magnum/tasks/deploy.yml +++ b/ansible/roles/magnum/tasks/deploy.yml @@ -6,6 +6,9 @@ when: inventory_hostname in groups['magnum-api'] or inventory_hostname in groups['magnum-conductor'] +- include: clone.yml + when: magnum_dev_mode | bool + - include: bootstrap.yml when: inventory_hostname in groups['magnum-api']