diff --git a/ansible/roles/senlin/defaults/main.yml b/ansible/roles/senlin/defaults/main.yml index 65ebf3b7e1..5515d0d106 100644 --- a/ansible/roles/senlin/defaults/main.yml +++ b/ansible/roles/senlin/defaults/main.yml @@ -11,6 +11,7 @@ senlin_services: - "{{ node_config_directory }}/senlin-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/senlin/senlin:/var/lib/kolla/venv/lib/python2.7/site-packages/senlin' if senlin_dev_mode | bool else '' }}" senlin-engine: container_name: senlin_engine group: senlin-engine @@ -20,6 +21,7 @@ senlin_services: - "{{ node_config_directory }}/senlin-engine/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/senlin/senlin:/var/lib/kolla/venv/lib/python2.7/site-packages/senlin' if senlin_dev_mode | bool else '' }}" #################### # Database @@ -56,3 +58,11 @@ senlin_logging_debug: "{{ openstack_logging_debug }}" senlin_keystone_user: "senlin" openstack_senlin_auth: "{{ openstack_auth }}" + + +#################### +# Kolla +#################### +senlin_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +senlin_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +senlin_dev_mode: "{{ kolla_dev_mode }}" diff --git a/ansible/roles/senlin/handlers/main.yml b/ansible/roles/senlin/handlers/main.yml index 43c017da8e..7e367d3d71 100644 --- a/ansible/roles/senlin/handlers/main.yml +++ b/ansible/roles/senlin/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] @@ -35,7 +35,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/senlin/tasks/bootstrap_service.yml b/ansible/roles/senlin/tasks/bootstrap_service.yml index 1fe89fb214..cc5a3961ea 100644 --- a/ansible/roles/senlin/tasks/bootstrap_service.yml +++ b/ansible/roles/senlin/tasks/bootstrap_service.yml @@ -14,6 +14,6 @@ BOOTSTRAP: name: "bootstrap_senlin" restart_policy: "never" - volumes: "{{ senlin_api.volumes }}" + volumes: "{{ senlin_api.volumes|reject('equalto', '')|list }}" run_once: True delegate_to: "{{ groups[senlin_api.group][0] }}" diff --git a/ansible/roles/senlin/tasks/clone.yml b/ansible/roles/senlin/tasks/clone.yml new file mode 100644 index 0000000000..453b3e4234 --- /dev/null +++ b/ansible/roles/senlin/tasks/clone.yml @@ -0,0 +1,6 @@ +--- +- name: Cloning senlin source repository for development + git: + repo: "{{ senlin_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ senlin_dev_repos_pull }}" diff --git a/ansible/roles/senlin/tasks/config.yml b/ansible/roles/senlin/tasks/config.yml index a460b8382d..d6f22617a4 100644 --- a/ansible/roles/senlin/tasks/config.yml +++ b/ansible/roles/senlin/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_senlin_containers when: - kolla_action != "config" diff --git a/ansible/roles/senlin/tasks/deploy.yml b/ansible/roles/senlin/tasks/deploy.yml index 7e02e41d90..b9792d9512 100644 --- a/ansible/roles/senlin/tasks/deploy.yml +++ b/ansible/roles/senlin/tasks/deploy.yml @@ -6,6 +6,9 @@ when: inventory_hostname in groups['senlin-api'] or inventory_hostname in groups['senlin-engine'] +- include: clone.yml + when: senlin_dev_mode | bool + - include: bootstrap.yml when: inventory_hostname in groups['senlin-api']