dev mode: Add support for magnum
Provide support fot kolla dev mode in Magnum. When 'kolla_dev_mode' or 'magnum_dev_mode' variables are enabled, source code of Magnum project is cloned and bindmounted. Partially implements: blueprint mount-sources Change-Id: Id479bf4dc77ee4a2367c9c7d8f0f00de761b8c85
This commit is contained in:
parent
e4c7b50320
commit
8533fc584b
@ -12,6 +12,7 @@ magnum_services:
|
|||||||
volumes:
|
volumes:
|
||||||
- "{{ node_config_directory }}/magnum-api/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/magnum-api/:{{ container_config_directory }}/:ro"
|
||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
|
- "{{ kolla_dev_repos_directory ~ '/magnum/magnum:/var/lib/kolla/venv/lib/python2.7/site-packages/magnum' if magnum_dev_mode | bool else '' }}"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "kolla_logs:/var/log/kolla/"
|
||||||
magnum-conductor:
|
magnum-conductor:
|
||||||
container_name: magnum_conductor
|
container_name: magnum_conductor
|
||||||
@ -23,6 +24,7 @@ magnum_services:
|
|||||||
- "{{ node_config_directory }}/magnum-conductor/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/magnum-conductor/:{{ container_config_directory }}/:ro"
|
||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
- "magnum:/var/lib/magnum/"
|
- "magnum:/var/lib/magnum/"
|
||||||
|
- "{{ kolla_dev_repos_directory ~ '/magnum/magnum:/var/lib/kolla/venv/lib/python2.7/site-packages/magnum' if magnum_dev_mode | bool else '' }}"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
|
||||||
|
|
||||||
@ -69,3 +71,11 @@ magnum_trustee_domain_admin: "magnum_trustee_domain_admin"
|
|||||||
magnum_trustee_domain: "magnum"
|
magnum_trustee_domain: "magnum"
|
||||||
|
|
||||||
openstack_magnum_auth: "{{ openstack_auth }}"
|
openstack_magnum_auth: "{{ openstack_auth }}"
|
||||||
|
|
||||||
|
|
||||||
|
####################
|
||||||
|
# Kolla
|
||||||
|
####################
|
||||||
|
magnum_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
|
||||||
|
magnum_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
|
||||||
|
magnum_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 }}"
|
||||||
environment: "{{ service.environment }}"
|
environment: "{{ service.environment }}"
|
||||||
when:
|
when:
|
||||||
- action != "config"
|
- action != "config"
|
||||||
@ -36,7 +36,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 }}"
|
||||||
environment: "{{ service.environment }}"
|
environment: "{{ service.environment }}"
|
||||||
when:
|
when:
|
||||||
- action != "config"
|
- action != "config"
|
||||||
|
@ -14,6 +14,6 @@
|
|||||||
BOOTSTRAP:
|
BOOTSTRAP:
|
||||||
name: "bootstrap_magnum"
|
name: "bootstrap_magnum"
|
||||||
restart_policy: "never"
|
restart_policy: "never"
|
||||||
volumes: "{{ magnum_api.volumes }}"
|
volumes: "{{ magnum_api.volumes|reject('equalto', '')|list }}"
|
||||||
run_once: True
|
run_once: True
|
||||||
delegate_to: "{{ groups[magnum_api.group][0] }}"
|
delegate_to: "{{ groups[magnum_api.group][0] }}"
|
||||||
|
6
ansible/roles/magnum/tasks/clone.yml
Normal file
6
ansible/roles/magnum/tasks/clone.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: Cloning magnum source repository for development
|
||||||
|
git:
|
||||||
|
repo: "{{ magnum_git_repository }}"
|
||||||
|
dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}"
|
||||||
|
update: "{{ magnum_dev_repos_pull }}"
|
@ -67,7 +67,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 }}"
|
||||||
environment: "{{ item.value.environment }}"
|
environment: "{{ item.value.environment }}"
|
||||||
register: check_magnum_containers
|
register: check_magnum_containers
|
||||||
when:
|
when:
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
when: inventory_hostname in groups['magnum-api'] or
|
when: inventory_hostname in groups['magnum-api'] or
|
||||||
inventory_hostname in groups['magnum-conductor']
|
inventory_hostname in groups['magnum-conductor']
|
||||||
|
|
||||||
|
- include: clone.yml
|
||||||
|
when: magnum_dev_mode | bool
|
||||||
|
|
||||||
- include: bootstrap.yml
|
- include: bootstrap.yml
|
||||||
when: inventory_hostname in groups['magnum-api']
|
when: inventory_hostname in groups['magnum-api']
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user