dev mode: Add support for ironic

Allows users to develop on ironic using Kolla.

Partially implements: blueprint mount-sources

Change-Id: I74540f5bcbf723f097f3dea96dcaf067834c493a
This commit is contained in:
wu.chunyang 2018-05-28 15:03:18 +00:00
parent f7950466e3
commit 291c04c87f
6 changed files with 33 additions and 6 deletions

View File

@ -11,6 +11,7 @@ ironic_services:
- "{{ node_config_directory }}/ironic-api/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla"
- "{{ kolla_dev_repos_directory ~ '/ironic/ironic:/var/lib/kolla/venv/lib/python2.7/site-packages/ironic' if ironic_dev_mode | bool else '' }}"
ironic-conductor:
container_name: ironic_conductor
group: ironic-conductor
@ -28,6 +29,7 @@ ironic_services:
- "ironic:/var/lib/ironic"
- "ironic_pxe:/tftpboot/"
- "ironic_ipxe:/httpboot/"
- "{{ kolla_dev_repos_directory ~ '/ironic/ironic:/var/lib/kolla/venv/lib/python2.7/site-packages/ironic' if ironic_dev_mode | bool else '' }}"
ironic-inspector:
container_name: ironic_inspector
group: ironic-inspector
@ -38,6 +40,7 @@ ironic_services:
- "{{ node_config_directory }}/ironic-inspector/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla"
- "{{ kolla_dev_repos_directory ~ '/ironic-inspector/ironic_inspector:/var/lib/kolla/venv/lib/python2.7/site-packages/ironic_inspector' if ironic_dev_mode | bool else '' }}"
ironic-pxe:
container_name: ironic_pxe
group: ironic-pxe
@ -140,3 +143,12 @@ ironic_dnsmasq_boot_file: "{% if enable_ironic_ipxe | bool %}undionly.kpxe{% els
ironic_cleaning_network:
ironic_console_serial_speed: "115200n8"
ironic_ipxe_url: http://{{ api_interface_address }}:{{ ironic_ipxe_port }}
####################
## Kolla
#####################
ironic_inspector_git_repository: "{{ kolla_dev_repos_git }}/ironic-inspector"
ironic_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
ironic_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
ironic_dev_mode: "{{ kolla_dev_mode }}"

View File

@ -12,7 +12,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -36,7 +36,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -59,7 +59,7 @@
name: "{{ service.container_name }}"
image: "{{ service.image }}"
privileged: "{{ service.privileged | default(False) }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -14,7 +14,7 @@
BOOTSTRAP:
name: "bootstrap_ironic"
restart_policy: "never"
volumes: "{{ ironic_api.volumes }}"
volumes: "{{ ironic_api.volumes|reject('equalto', '')|list }}"
run_once: True
delegate_to: "{{ groups[ironic_api.group][0] }}"
when: inventory_hostname in groups[ironic_api.group]
@ -34,7 +34,7 @@
BOOTSTRAP:
name: "bootstrap_ironic_inspector"
restart_policy: "never"
volumes: "{{ ironic_inspector.volumes }}"
volumes: "{{ ironic_inspector.volumes|reject('equalto', '')|list }}"
run_once: True
delegate_to: "{{ groups[ironic_inspector.group][0] }}"
when: inventory_hostname in groups[ironic_inspector.group]

View File

@ -0,0 +1,12 @@
---
- name: Cloning ironic source repository for development
git:
repo: "{{ ironic_git_repository }}"
dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}"
update: "{{ ironic_dev_repos_pull }}"
- name: Cloning ironic-inspector source repository for development
git:
repo: "{{ ironic_inspector_git_repository }}"
dest: "{{ kolla_dev_repos_directory }}/ironic-inspector"
update: "{{ ironic_dev_repos_pull }}"

View File

@ -258,7 +258,7 @@
image: "{{ item.value.image }}"
privileged: "{{ item.value.privileged|default(False) }}"
cap_add: "{{ item.value.cap_add|default([]) }}"
volumes: "{{ item.value.volumes }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
register: check_ironic_containers
when:
- kolla_action != "config"

View File

@ -11,6 +11,9 @@
inventory_hostname in groups['ironic-pxe'] or
inventory_hostname in groups['ironic-ipxe']
- include: clone.yml
when: ironic_dev_mode | bool
- include: bootstrap.yml
when: inventory_hostname in groups['ironic-api'] or
inventory_hostname in groups['ironic-inspector'] or