Add support of octavia dev mod

Similarly to other OpenStack services octavia should support
kolla dev mod for debugging.

Change-Id: I81b79dc0a4c5e40a67af7120a4109dfe11098a97
This commit is contained in:
wu.chunyang 2020-06-14 23:42:09 +08:00
parent e2acee87ee
commit 36b93dd6e2
6 changed files with 32 additions and 5 deletions

View File

@ -90,21 +90,25 @@ octavia_api_default_volumes:
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if kolla_base_distro in ['debian', 'ubuntu'] else '' }}"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/octavia/octavia:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/octavia' }}"
octavia_health_manager_default_volumes:
- "{{ node_config_directory }}/octavia-health-manager/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if kolla_base_distro in ['debian', 'ubuntu'] else '' }}"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/octavia/octavia:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/octavia' if octavia_dev_mode | bool else '' }}"
octavia_housekeeping_default_volumes:
- "{{ node_config_directory }}/octavia-housekeeping/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if kolla_base_distro in ['debian', 'ubuntu'] else '' }}"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/octavia/octavia:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/octavia' if octavia_dev_mode | bool else '' }}"
octavia_worker_default_volumes:
- "{{ node_config_directory }}/octavia-worker/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if kolla_base_distro in ['debian', 'ubuntu'] else '' }}"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/octavia/octavia:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/octavia' if octavia_dev_mode | bool else '' }}"
octavia_extra_volumes: "{{ default_extra_volumes }}"
octavia_api_extra_volumes: "{{ octavia_extra_volumes }}"
@ -146,3 +150,11 @@ octavia_ks_users:
user: "{{ octavia_keystone_user }}"
password: "{{ octavia_keystone_password }}"
role: "admin"
####################
# Kolla
####################
octavia_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
octavia_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
octavia_dev_mode: "{{ kolla_dev_mode }}"
octavia_source_version: "{{ kolla_source_version }}"

View File

@ -9,7 +9,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
@ -24,7 +24,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
@ -39,7 +39,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
@ -54,7 +54,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"

View File

@ -15,6 +15,6 @@
BOOTSTRAP:
name: "bootstrap_octavia"
restart_policy: no
volumes: "{{ octavia_api.volumes }}"
volumes: "{{ octavia_api.volumes | reject('equalto', '') | list }}"
run_once: True
delegate_to: "{{ groups[octavia_api.group][0] }}"

View File

@ -0,0 +1,8 @@
---
- name: Cloning octavia source repository for development
become: true
git:
repo: "{{ octavia_git_repository }}"
dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}"
update: "{{ octavia_dev_repos_pull }}"
version: "{{ octavia_source_version }}"

View File

@ -8,6 +8,9 @@
inventory_hostname in groups['octavia-housekeeping'] or
inventory_hostname in groups['octavia-worker']
- include_tasks: clone.yml
when: octavia_dev_mode | bool
- include_tasks: bootstrap.yml
when: inventory_hostname in groups['octavia-api']

View File

@ -0,0 +1,4 @@
---
features:
- |
add support of octavia dev mod.