diff --git a/ansible/roles/glance/defaults/main.yml b/ansible/roles/glance/defaults/main.yml index 85740a14d5..94b80a3851 100644 --- a/ansible/roles/glance/defaults/main.yml +++ b/ansible/roles/glance/defaults/main.yml @@ -11,6 +11,7 @@ glance_services: - "{{ node_config_directory }}/glance-api/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "{{ glance_file_datadir_volume }}:/var/lib/glance/" + - "{{ kolla_dev_repos_directory ~ '/glance/glance:/var/lib/kolla/venv/lib/python2.7/site-packages/glance' if glance_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" glance-registry: container_name: glance_registry @@ -94,6 +95,13 @@ glance_keystone_user: "glance" openstack_glance_auth: "{{ openstack_auth }}" +################### +# Kolla +#################### +glance_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +glance_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +glance_dev_mode: "{{ kolla_dev_mode }}" + ################################################ # VMware - OpenStack VMware support ################################################ diff --git a/ansible/roles/glance/tasks/clone.yml b/ansible/roles/glance/tasks/clone.yml new file mode 100644 index 0000000000..a85e10eb2a --- /dev/null +++ b/ansible/roles/glance/tasks/clone.yml @@ -0,0 +1,6 @@ +--- +- name: Cloning source repositories for development + git: + repo: "{{ glance_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ glance_dev_repos_pull }}" diff --git a/ansible/roles/glance/tasks/deploy.yml b/ansible/roles/glance/tasks/deploy.yml index bc589e3fac..aed4e7bd66 100644 --- a/ansible/roles/glance/tasks/deploy.yml +++ b/ansible/roles/glance/tasks/deploy.yml @@ -19,6 +19,12 @@ when: inventory_hostname in groups['glance-api'] or inventory_hostname in groups['glance-registry'] +- include: clone.yml + when: + - glance_dev_mode | bool + - inventory_hostname in groups['glance-api'] or + inventory_hostname in groups['glance-registry'] + - include: bootstrap.yml when: inventory_hostname in groups['glance-api'] diff --git a/releasenotes/notes/glance-dev-mode-fefcff05286119f4.yaml b/releasenotes/notes/glance-dev-mode-fefcff05286119f4.yaml new file mode 100644 index 0000000000..3beff06664 --- /dev/null +++ b/releasenotes/notes/glance-dev-mode-fefcff05286119f4.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Glance can now be developed on using Kolla 'dev mode'.