Provide support for freezer dev mode in kolla
Add a possibility to mount sources as volumes to containers, in "more than documentation" way. That will let us to use kolla as a replacement for devstack. Partially implements: blueprint mount-sources Co-Authored-By: wu.chunyang <wu.chunyang@99cloud.net> Change-Id: Ia3112a0d297ac777e1f25d3ddecced7746ca6418
This commit is contained in:
parent
d03b6daf77
commit
e50d18e4fb
@ -12,6 +12,7 @@ freezer_services:
|
|||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "freezer:/var/lib/freezer/"
|
- "freezer:/var/lib/freezer/"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
- "{{ kolla_dev_repos_directory ~ '/freezer-api/freezer_api:/var/lib/kolla/venv/lib/python2.7/site-packages/freezer_api' if freezer_dev_mode | bool else '' }}"
|
||||||
dimensions: "{{ freezer_api_dimensions }}"
|
dimensions: "{{ freezer_api_dimensions }}"
|
||||||
freezer-scheduler:
|
freezer-scheduler:
|
||||||
container_name: freezer_scheduler
|
container_name: freezer_scheduler
|
||||||
@ -23,6 +24,7 @@ freezer_services:
|
|||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "freezer:/var/lib/freezer/"
|
- "freezer:/var/lib/freezer/"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
- "{{ kolla_dev_repos_directory ~ '/freezer/freezer:/var/lib/kolla/venv/lib/python2.7/site-packages/freezer' if freezer_dev_mode | bool else '' }}"
|
||||||
dimensions: "{{ freezer_scheduler_dimensions }}"
|
dimensions: "{{ freezer_scheduler_dimensions }}"
|
||||||
|
|
||||||
|
|
||||||
@ -55,3 +57,12 @@ freezer_logging_debug: "{{ openstack_logging_debug }}"
|
|||||||
freezer_keystone_user: "freezer"
|
freezer_keystone_user: "freezer"
|
||||||
|
|
||||||
openstack_freezer_auth: "{{ openstack_auth }}"
|
openstack_freezer_auth: "{{ openstack_auth }}"
|
||||||
|
|
||||||
|
|
||||||
|
####################
|
||||||
|
# Kolla
|
||||||
|
####################
|
||||||
|
freezer_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
|
||||||
|
freezer_api_git_repository: "{{ kolla_dev_repos_git }}/freezer-api"
|
||||||
|
freezer_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
|
||||||
|
freezer_dev_mode: "{{ kolla_dev_mode }}"
|
||||||
|
@ -39,7 +39,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 }}"
|
||||||
dimensions: "{{ service.dimensions }}"
|
dimensions: "{{ service.dimensions }}"
|
||||||
when:
|
when:
|
||||||
- kolla_action != "config"
|
- kolla_action != "config"
|
||||||
|
@ -15,6 +15,6 @@
|
|||||||
BOOTSTRAP:
|
BOOTSTRAP:
|
||||||
name: "bootstrap_freezer"
|
name: "bootstrap_freezer"
|
||||||
restart_policy: "never"
|
restart_policy: "never"
|
||||||
volumes: "{{ freezer_api.volumes }}"
|
volumes: "{{ freezer_api.volumes | reject('equalto', '') | list }}"
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups[freezer_api.group][0] }}"
|
delegate_to: "{{ groups[freezer_api.group][0] }}"
|
||||||
|
12
ansible/roles/freezer/tasks/clone.yml
Normal file
12
ansible/roles/freezer/tasks/clone.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
- name: Cloning freezer source repository for development
|
||||||
|
git:
|
||||||
|
repo: "{{ freezer_git_repository }}"
|
||||||
|
dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}"
|
||||||
|
update: "{{ freezer_dev_repos_pull }}"
|
||||||
|
|
||||||
|
- name: Cloning freezer-api source repository for development
|
||||||
|
git:
|
||||||
|
repo: "{{ freezer_api_git_repository }}"
|
||||||
|
dest: "{{ kolla_dev_repos_directory }}/freezer-api"
|
||||||
|
update: "{{ freezer_dev_repos_pull }}"
|
@ -101,7 +101,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
name: "{{ item.value.container_name }}"
|
name: "{{ item.value.container_name }}"
|
||||||
image: "{{ item.value.image }}"
|
image: "{{ item.value.image }}"
|
||||||
volumes: "{{ item.value.volumes }}"
|
volumes: "{{ item.value.volumes | reject('equalto', '') | list }}"
|
||||||
dimensions: "{{ item.value.dimensions }}"
|
dimensions: "{{ item.value.dimensions }}"
|
||||||
register: check_freezer_containers
|
register: check_freezer_containers
|
||||||
when:
|
when:
|
||||||
|
@ -9,5 +9,8 @@
|
|||||||
- include_tasks: bootstrap_service.yml
|
- include_tasks: bootstrap_service.yml
|
||||||
when: inventory_hostname in groups['freezer-api']
|
when: inventory_hostname in groups['freezer-api']
|
||||||
|
|
||||||
|
- include_tasks: clone.yml
|
||||||
|
when: freezer_dev_mode | bool
|
||||||
|
|
||||||
- name: Flush handlers
|
- name: Flush handlers
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user