diff --git a/ansible/roles/zun/defaults/main.yml b/ansible/roles/zun/defaults/main.yml index 840a60c4bc..1b5e29fef5 100644 --- a/ansible/roles/zun/defaults/main.yml +++ b/ansible/roles/zun/defaults/main.yml @@ -10,6 +10,7 @@ zun_services: volumes: - "{{ node_config_directory }}/zun-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" + - "{{ kolla_dev_repos_directory ~ '/zun/zun:/var/lib/kolla/venv/lib/python2.7/site-packages/zun' if zun_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" zun-compute: container_name: zun_compute @@ -21,6 +22,7 @@ zun_services: - "{{ node_config_directory }}/zun-compute/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/zun/zun:/var/lib/kolla/venv/lib/python2.7/site-packages/zun' if zun_dev_mode | bool else '' }}" - "/run:/run:shared" - "/usr/lib/docker:/usr/lib/docker" @@ -59,3 +61,11 @@ zun_logging_debug: "{{ openstack_logging_debug }}" zun_keystone_user: "zun" openstack_zun_auth: "{{ openstack_auth }}" + + +#################### +# Kolla +#################### +zun_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +zun_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +zun_dev_mode: "{{ kolla_dev_mode }}" diff --git a/ansible/roles/zun/handlers/main.yml b/ansible/roles/zun/handlers/main.yml index 739ce01822..0bd2ff85c6 100644 --- a/ansible/roles/zun/handlers/main.yml +++ b/ansible/roles/zun/handlers/main.yml @@ -13,7 +13,7 @@ name: "{{ service.container_name }}" image: "{{ service.image }}" privileged: "{{ service.privileged | default(False) }}" - volumes: "{{ service.volumes }}" + volumes: "{{ service.volumes|reject('equalto', '')|list }}" when: - action != "config" - inventory_hostname in groups[service.group] @@ -38,7 +38,7 @@ name: "{{ service.container_name }}" image: "{{ service.image }}" privileged: "{{ service.privileged | default(False) }}" - volumes: "{{ service.volumes }}" + volumes: "{{ service.volumes|reject('equalto', '')|list }}" when: - action != "config" - inventory_hostname in groups[service.group] diff --git a/ansible/roles/zun/tasks/bootstrap_service.yml b/ansible/roles/zun/tasks/bootstrap_service.yml index 32de6f06a6..fd5480c9d8 100644 --- a/ansible/roles/zun/tasks/bootstrap_service.yml +++ b/ansible/roles/zun/tasks/bootstrap_service.yml @@ -14,6 +14,6 @@ BOOTSTRAP: name: "bootstrap_zun" restart_policy: "never" - volumes: "{{ zun_api.volumes }}" + volumes: "{{ zun_api.volumes|reject('equalto', '')|list }}" run_once: True delegate_to: "{{ groups[zun_api.group][0] }}" diff --git a/ansible/roles/zun/tasks/clone.yml b/ansible/roles/zun/tasks/clone.yml new file mode 100644 index 0000000000..c3f35c2504 --- /dev/null +++ b/ansible/roles/zun/tasks/clone.yml @@ -0,0 +1,6 @@ +--- +- name: Cloning zun source repository for development + git: + repo: "{{ zun_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ zun_dev_repos_pull }}" diff --git a/ansible/roles/zun/tasks/config.yml b/ansible/roles/zun/tasks/config.yml index d85fe5e982..bd4c1cf2aa 100644 --- a/ansible/roles/zun/tasks/config.yml +++ b/ansible/roles/zun/tasks/config.yml @@ -101,7 +101,7 @@ name: "{{ item.value.container_name }}" image: "{{ item.value.image }}" privileged: "{{ item.value.privileged | default(False) }}" - volumes: "{{ item.value.volumes }}" + volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" register: check_zun_containers when: - action != "config" diff --git a/ansible/roles/zun/tasks/deploy.yml b/ansible/roles/zun/tasks/deploy.yml index ce46a42af7..15e3410d4f 100644 --- a/ansible/roles/zun/tasks/deploy.yml +++ b/ansible/roles/zun/tasks/deploy.yml @@ -6,6 +6,9 @@ when: inventory_hostname in groups['zun-api'] or inventory_hostname in groups['zun-compute'] +- include: clone.yml + when: zun_dev_mode | bool + - include: bootstrap.yml when: inventory_hostname in groups['zun-api']