From dbe7b591d482590be3b62c2a67fedb0e68b3888d Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Thu, 17 Aug 2017 14:36:52 +0100 Subject: [PATCH] Add dev mode for glance Allows users to develop on Glance using Kolla. Change-Id: I2c7c97ddf84ca19505cf01adaf982c6a3f70d7d0 Partially-Implements: blueprint mount-sources --- ansible/roles/glance/defaults/main.yml | 8 ++++++++ ansible/roles/glance/tasks/clone.yml | 6 ++++++ ansible/roles/glance/tasks/deploy.yml | 6 ++++++ releasenotes/notes/glance-dev-mode-fefcff05286119f4.yaml | 4 ++++ 4 files changed, 24 insertions(+) create mode 100644 ansible/roles/glance/tasks/clone.yml create mode 100644 releasenotes/notes/glance-dev-mode-fefcff05286119f4.yaml diff --git a/ansible/roles/glance/defaults/main.yml b/ansible/roles/glance/defaults/main.yml index 53ce07891c..855c8df179 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 @@ -90,6 +91,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'.