diff --git a/ansible/roles/cloudkitty/defaults/main.yml b/ansible/roles/cloudkitty/defaults/main.yml index aa8f3f33da..688da5a4da 100644 --- a/ansible/roles/cloudkitty/defaults/main.yml +++ b/ansible/roles/cloudkitty/defaults/main.yml @@ -11,6 +11,7 @@ cloudkitty_services: - "{{ node_config_directory }}/cloudkitty-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/cloudkitty/cloudkitty:/var/lib/kolla/venv/lib/python2.7/site-packages/cloudkitty' if cloudkitty_dev_mode | bool else '' }}" cloudkitty-processor: container_name: "cloudkitty_processor" group: "cloudkitty-processor" @@ -20,6 +21,7 @@ cloudkitty_services: - "{{ node_config_directory }}/cloudkitty-processor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/cloudkitty/cloudkitty:/var/lib/kolla/venv/lib/python2.7/site-packages/cloudkitty' if cloudkitty_dev_mode | bool else '' }}" #################### @@ -62,3 +64,11 @@ openstack_cloudkitty_auth: "{{ openstack_auth }}" # Cloudkitty #################### cloudkitty_openstack_keystone_default_role: "rating" + + +#################### +# Kolla +#################### +cloudkitty_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +cloudkitty_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +cloudkitty_dev_mode: "{{ kolla_dev_mode }}" diff --git a/ansible/roles/cloudkitty/handlers/main.yml b/ansible/roles/cloudkitty/handlers/main.yml index 5ed65a8d03..419b8978ef 100644 --- a/ansible/roles/cloudkitty/handlers/main.yml +++ b/ansible/roles/cloudkitty/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] @@ -38,7 +38,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/cloudkitty/tasks/bootstrap_service.yml b/ansible/roles/cloudkitty/tasks/bootstrap_service.yml index 1f401bfd5e..35305c7d13 100644 --- a/ansible/roles/cloudkitty/tasks/bootstrap_service.yml +++ b/ansible/roles/cloudkitty/tasks/bootstrap_service.yml @@ -15,6 +15,6 @@ BOOTSTRAP: name: "bootstrap_cloudkitty" restart_policy: "never" - volumes: "{{ cloudkitty_api.volumes }}" + volumes: "{{ cloudkitty_api.volumes|reject('equalto', '')|list }}" run_once: True delegate_to: "{{ groups[cloudkitty_api.group][0] }}" diff --git a/ansible/roles/cloudkitty/tasks/clone.yml b/ansible/roles/cloudkitty/tasks/clone.yml new file mode 100644 index 0000000000..906be97d92 --- /dev/null +++ b/ansible/roles/cloudkitty/tasks/clone.yml @@ -0,0 +1,6 @@ +--- +- name: Cloning cloudkitty source repository for development + git: + repo: "{{ cloudkitty_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ cloudkitty_dev_repos_pull }}" diff --git a/ansible/roles/cloudkitty/tasks/config.yml b/ansible/roles/cloudkitty/tasks/config.yml index c750bb935e..359cbadf7d 100644 --- a/ansible/roles/cloudkitty/tasks/config.yml +++ b/ansible/roles/cloudkitty/tasks/config.yml @@ -104,7 +104,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_cloudkitty_containers when: - kolla_action != "config" diff --git a/ansible/roles/cloudkitty/tasks/deploy.yml b/ansible/roles/cloudkitty/tasks/deploy.yml index f066c0dfbb..aae4a8a4d9 100644 --- a/ansible/roles/cloudkitty/tasks/deploy.yml +++ b/ansible/roles/cloudkitty/tasks/deploy.yml @@ -6,6 +6,9 @@ when: inventory_hostname in groups['cloudkitty-api'] or inventory_hostname in groups['cloudkitty-processor'] +- include: clone.yml + when: cloudkitty_dev_mode | bool + - include: bootstrap.yml when: inventory_hostname in groups['cloudkitty-api']