diff --git a/ansible/roles/solum/defaults/main.yml b/ansible/roles/solum/defaults/main.yml index 434d03bfca31941f847e0145c25935903346fb83..7c4546d2620aa54f0512dc7f1e14b4296168c01d 100644 --- a/ansible/roles/solum/defaults/main.yml +++ b/ansible/roles/solum/defaults/main.yml @@ -11,6 +11,7 @@ solum_services: - "{{ node_config_directory }}/solum-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/solum/solum:/var/lib/kolla/venv/lib/python2.7/site-packages/solum' if solum_dev_mode | bool else '' }}" solum-worker: container_name: solum_worker group: solum-worker @@ -20,6 +21,7 @@ solum_services: - "{{ node_config_directory }}/solum-worker/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/solum/solum:/var/lib/kolla/venv/lib/python2.7/site-packages/solum' if solum_dev_mode | bool else '' }}" solum-deployer: container_name: solum_deployer group: solum-deployer @@ -29,6 +31,7 @@ solum_services: - "{{ node_config_directory }}/solum-deployer/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/solum/solum:/var/lib/kolla/venv/lib/python2.7/site-packages/solum' if solum_dev_mode | bool else '' }}" solum-conductor: container_name: solum_conductor group: solum-conductor @@ -38,6 +41,7 @@ solum_services: - "{{ node_config_directory }}/solum-conductor/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/solum/solum:/var/lib/kolla/venv/lib/python2.7/site-packages/solum' if solum_dev_mode | bool else '' }}" #################### @@ -87,3 +91,11 @@ solum_logging_debug: "{{ openstack_logging_debug }}" solum_keystone_user: "solum" openstack_solum_auth: "{{ openstack_auth }}" + + +#################### +# Kolla +#################### +solum_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +solum_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +solum_dev_mode: "{{ kolla_dev_mode }}" diff --git a/ansible/roles/solum/handlers/main.yml b/ansible/roles/solum/handlers/main.yml index ae4f6f4f40e90391552652a1814515b09e090dc6..0e122dea768e8ac7a0267426dd9ee20e4d11e78f 100644 --- a/ansible/roles/solum/handlers/main.yml +++ b/ansible/roles/solum/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 }}" when: - kolla_action != "config" - inventory_hostname in groups[service.group] @@ -34,7 +34,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] @@ -56,7 +56,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] @@ -78,7 +78,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/solum/tasks/bootstrap_service.yml b/ansible/roles/solum/tasks/bootstrap_service.yml index 0d20835719f081708875c1a3d93fe7a317fb8525..fc63c094b5a49ab4da7c53ba1db22df356ced3fd 100644 --- a/ansible/roles/solum/tasks/bootstrap_service.yml +++ b/ansible/roles/solum/tasks/bootstrap_service.yml @@ -15,6 +15,6 @@ BOOTSTRAP: name: "bootstrap_solum" restart_policy: "never" - volumes: "{{ solum_api.volumes }}" + volumes: "{{ solum_api.volumes|reject('equalto', '')|list }}" run_once: True delegate_to: "{{ groups[solum_api.group][0] }}" diff --git a/ansible/roles/solum/tasks/clone.yml b/ansible/roles/solum/tasks/clone.yml new file mode 100644 index 0000000000000000000000000000000000000000..60583449952da5765ba27801a7f937e9d71651c5 --- /dev/null +++ b/ansible/roles/solum/tasks/clone.yml @@ -0,0 +1,6 @@ +--- +- name: Cloning solum source repository for development + git: + repo: "{{ solum_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ solum_dev_repos_pull }}" diff --git a/ansible/roles/solum/tasks/config.yml b/ansible/roles/solum/tasks/config.yml index 346fef1b88a3d66657b1de0c22c76bea3867e455..c286fc1ad33077c382e7d7ee8992894625b88134 100644 --- a/ansible/roles/solum/tasks/config.yml +++ b/ansible/roles/solum/tasks/config.yml @@ -60,7 +60,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_solum_containers when: - kolla_action != "config" diff --git a/ansible/roles/solum/tasks/deploy.yml b/ansible/roles/solum/tasks/deploy.yml index 40486519880252377e39cff1bc420a8a0d1f6745..922adfaa0d241d2bf12d00f846ec4f2c35794d70 100644 --- a/ansible/roles/solum/tasks/deploy.yml +++ b/ansible/roles/solum/tasks/deploy.yml @@ -8,6 +8,9 @@ inventory_hostname in groups['solum-worker'] or inventory_hostname in groups['solum-conductor'] +- include: clone.yml + when: solum_dev_mode | bool + - include: bootstrap.yml when: inventory_hostname in groups['solum-api']