From 307d324f36fbd1272b25e867f79dbb91048028c1 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Thu, 4 Jan 2018 12:15:17 +0100 Subject: [PATCH] dev mode: Add support for keystone Provide support fot kolla dev mode in Keystone. When 'kolla_dev_mode' or 'keystone_dev_mode' variables are enabled, source code of Keystone project is cloned and bindmounted. Partially implements: blueprint mount-sources Change-Id: Ie4cf401ecd9a507e739a53dfdf16f65292ab57e5 --- ansible/roles/keystone/defaults/main.yml | 9 +++++++++ ansible/roles/keystone/tasks/clone.yml | 6 ++++++ ansible/roles/keystone/tasks/deploy.yml | 4 ++++ 3 files changed, 19 insertions(+) create mode 100644 ansible/roles/keystone/tasks/clone.yml diff --git a/ansible/roles/keystone/defaults/main.yml b/ansible/roles/keystone/defaults/main.yml index 05527bbad3..5f4234829f 100644 --- a/ansible/roles/keystone/defaults/main.yml +++ b/ansible/roles/keystone/defaults/main.yml @@ -10,6 +10,7 @@ keystone_services: volumes: - "{{ node_config_directory }}/keystone/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" + - "{{ kolla_dev_repos_directory ~ '/keystone/keystone:/var/lib/kolla/venv/lib/python2.7/site-packages/keystone' if keystone_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" - "{% if keystone_token_provider == 'fernet' %}keystone_fernet_tokens:/etc/keystone/fernet-keys{% endif %}" keystone-ssh: @@ -74,3 +75,11 @@ keystone_ssh_image_full: "{{ keystone_ssh_image }}:{{ keystone_ssh_tag }}" keystone_logging_debug: "{{ openstack_logging_debug }}" openstack_keystone_auth: "{{ openstack_auth }}" + + +#################### +# Kolla +#################### +keystone_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +keystone_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +keystone_dev_mode: "{{ kolla_dev_mode }}" diff --git a/ansible/roles/keystone/tasks/clone.yml b/ansible/roles/keystone/tasks/clone.yml new file mode 100644 index 0000000000..b1105344c4 --- /dev/null +++ b/ansible/roles/keystone/tasks/clone.yml @@ -0,0 +1,6 @@ +--- +- name: Cloning keystone source repository for development + git: + repo: "{{ keystone_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ keystone_dev_repos_pull }}" diff --git a/ansible/roles/keystone/tasks/deploy.yml b/ansible/roles/keystone/tasks/deploy.yml index a730c46f35..5bb94610eb 100644 --- a/ansible/roles/keystone/tasks/deploy.yml +++ b/ansible/roles/keystone/tasks/deploy.yml @@ -1,6 +1,10 @@ --- - include: config.yml +- include: clone.yml + when: + - keystone_dev_mode | bool + - include: bootstrap.yml - name: Flush handlers