dev mode: Add support for sahara
Provide support fot kolla dev mode in sahara. When 'kolla_dev_mode' or 'sahara_dev_mode' variables are enabled, source code of sahara project will be cloned and mounted automatically Partially implements: blueprint mount-sources Change-Id: I496ea4443ec8ffc4dc9d0f0d3e6a4514d16ed336 Co-Authored-By: zhulingjie <easyzlj@gmail.com>
This commit is contained in:
parent
e88b9a7ad4
commit
31a6de01f3
@ -12,6 +12,7 @@ sahara_services:
|
|||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "sahara:/var/lib/sahara/"
|
- "sahara:/var/lib/sahara/"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
- "{{ kolla_dev_repos_directory ~ '/sahara/sahara:/var/lib/kolla/venv/lib/python2.7/site-packages/sahara' if sahara_dev_mode | bool else '' }}"
|
||||||
sahara-engine:
|
sahara-engine:
|
||||||
container_name: sahara_engine
|
container_name: sahara_engine
|
||||||
group: sahara-engine
|
group: sahara-engine
|
||||||
@ -24,6 +25,7 @@ sahara_services:
|
|||||||
- "sahara:/var/lib/sahara/"
|
- "sahara:/var/lib/sahara/"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "kolla_logs:/var/log/kolla/"
|
||||||
- "/run:/run:shared"
|
- "/run:/run:shared"
|
||||||
|
- "{{ kolla_dev_repos_directory ~ '/sahara/sahara:/var/lib/kolla/venv/lib/python2.7/site-packages/sahara' if sahara_dev_mode | bool else '' }}"
|
||||||
|
|
||||||
|
|
||||||
####################
|
####################
|
||||||
@ -61,3 +63,11 @@ sahara_logging_debug: "{{ openstack_logging_debug }}"
|
|||||||
sahara_keystone_user: "sahara"
|
sahara_keystone_user: "sahara"
|
||||||
|
|
||||||
openstack_sahara_auth: "{{ openstack_auth }}"
|
openstack_sahara_auth: "{{ openstack_auth }}"
|
||||||
|
|
||||||
|
|
||||||
|
####################
|
||||||
|
## Kolla
|
||||||
|
#####################
|
||||||
|
sahara_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
|
||||||
|
sahara_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
|
||||||
|
sahara_dev_mode: "{{ kolla_dev_mode }}"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ service.container_name }}"
|
name: "{{ service.container_name }}"
|
||||||
image: "{{ service.image }}"
|
image: "{{ service.image }}"
|
||||||
volumes: "{{ service.volumes }}"
|
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
- inventory_hostname in groups[service.group]
|
- inventory_hostname in groups[service.group]
|
||||||
@ -35,7 +35,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ service.container_name }}"
|
name: "{{ service.container_name }}"
|
||||||
image: "{{ service.image }}"
|
image: "{{ service.image }}"
|
||||||
volumes: "{{ service.volumes }}"
|
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
|
||||||
privileged: "{{ service.privileged | default(False) }}"
|
privileged: "{{ service.privileged | default(False) }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
|
@ -14,6 +14,6 @@
|
|||||||
BOOTSTRAP:
|
BOOTSTRAP:
|
||||||
name: "bootstrap_sahara"
|
name: "bootstrap_sahara"
|
||||||
restart_policy: "never"
|
restart_policy: "never"
|
||||||
volumes: "{{ sahara_api.volumes }}"
|
volumes: "{{ sahara_api.volumes|reject('equalto', '')|list }}"
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups[sahara_api.group][0] }}"
|
delegate_to: "{{ groups[sahara_api.group][0] }}"
|
||||||
|
6
ansible/roles/sahara/tasks/clone.yml
Normal file
6
ansible/roles/sahara/tasks/clone.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: Cloning sahara source repository for development
|
||||||
|
git:
|
||||||
|
repo: "{{ sahara_git_repository }}"
|
||||||
|
dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}"
|
||||||
|
update: "{{ sahara_dev_repos_pull }}"
|
@ -89,7 +89,7 @@
|
|||||||
name: "{{ item.value.container_name }}"
|
name: "{{ item.value.container_name }}"
|
||||||
image: "{{ item.value.image }}"
|
image: "{{ item.value.image }}"
|
||||||
privileged: "{{ item.value.privileged | default(False) }}"
|
privileged: "{{ item.value.privileged | default(False) }}"
|
||||||
volumes: "{{ item.value.volumes }}"
|
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
|
||||||
register: check_sahara_containers
|
register: check_sahara_containers
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
when: inventory_hostname in groups['sahara-api'] or
|
when: inventory_hostname in groups['sahara-api'] or
|
||||||
inventory_hostname in groups['sahara-engine']
|
inventory_hostname in groups['sahara-engine']
|
||||||
|
|
||||||
|
- include: clone.yml
|
||||||
|
when: sahara_dev_mode | bool
|
||||||
|
|
||||||
- include: bootstrap.yml
|
- include: bootstrap.yml
|
||||||
when: inventory_hostname in groups['sahara-api']
|
when: inventory_hostname in groups['sahara-api']
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user