Merge "Add support for making Bifrost optional"

This commit is contained in:
Zuul
2025-06-13 14:12:17 +00:00
committed by Gerrit Code Review
9 changed files with 59 additions and 33 deletions

View File

@@ -4,6 +4,9 @@
###############################################################################
# Bifrost installation.
# Whether to install Bifrost. Default is true.
kolla_enable_bifrost: true
# URL of Bifrost source code repository.
kolla_bifrost_source_url: "https://opendev.org/openstack/bifrost"

View File

@@ -17,3 +17,5 @@
kolla_bifrost_config_paths_static:
- "{{ kayobe_config_path }}"
kolla_bifrost_config_paths_extra: "{{ kolla_bifrost_config_paths_static + kayobe_env_search_paths }}"
kolla_bifrost_config_files:
when: kolla_enable_bifrost | bool

View File

@@ -320,3 +320,9 @@ kolla_https_proxy:
# List of domains, hostnames, IP addresses and networks for which no proxy is
# used.
kolla_no_proxy:
###############################################################################
# Bifrost configuration
# Whether to install Bifrost. Default is true.
kolla_enable_bifrost: true

View File

@@ -15,4 +15,6 @@ virtualenv={{ kolla_ansible_target_venv }}
seed
[bifrost:children]
{% if kolla_enable_bifrost | bool %}
seed
{% endif %}

View File

@@ -9,39 +9,42 @@
vars:
openstack_config_dir: "{{ ansible_facts.env.HOME }}/.config/openstack"
tasks:
- name: Ensure OpenStack config directory exists
file:
path: "{{ openstack_config_dir }}"
state: directory
mode: 0700
- name: Ensure credentials are available on the host
when: kolla_enable_bifrost | bool
block:
- name: Ensure OpenStack config directory exists
file:
path: "{{ openstack_config_dir }}"
state: directory
mode: 0700
- name: Get clouds.yaml from Bifrost container
command:
cmd: "{{ container_engine }} exec bifrost_deploy cat /root/.config/openstack/clouds.yaml"
changed_when: false
register: clouds_yaml
no_log: true
become: "{{ container_engine == 'podman' }}"
- name: Get clouds.yaml from Bifrost container
command:
cmd: "{{ container_engine }} exec bifrost_deploy cat /root/.config/openstack/clouds.yaml"
changed_when: false
register: clouds_yaml
no_log: true
become: "{{ container_engine == 'podman' }}"
- name: Write clouds.yaml
copy:
content: |
{%- set clouds = clouds_yaml.stdout | from_yaml -%}
{%- for cloud in clouds.clouds.keys() | list -%}
{%- if 'cacert' in clouds.clouds[cloud] -%}
{%- set _ = clouds.clouds[cloud].update({'cacert': openstack_config_dir ~ '/bifrost.crt'}) -%}
{%- endif -%}
{%- endfor -%}
{{ clouds | to_nice_yaml }}
dest: "{{ openstack_config_dir }}/clouds.yaml"
mode: 0600
- name: Write clouds.yaml
copy:
content: |
{%- set clouds = clouds_yaml.stdout | from_yaml -%}
{%- for cloud in clouds.clouds.keys() | list -%}
{%- if 'cacert' in clouds.clouds[cloud] -%}
{%- set _ = clouds.clouds[cloud].update({'cacert': openstack_config_dir ~ '/bifrost.crt'}) -%}
{%- endif -%}
{%- endfor -%}
{{ clouds | to_nice_yaml }}
dest: "{{ openstack_config_dir }}/clouds.yaml"
mode: 0600
- name: Copy CA certificate from Bifrost container
vars:
clouds: "{{ clouds_yaml.stdout | from_yaml }}"
cacerts: "{{ clouds.clouds.values() | selectattr('cacert', 'defined') | map(attribute='cacert') | list }}"
command:
cmd: "{{ container_engine }} cp bifrost_deploy:{{ cacerts[0] }} {{ openstack_config_dir }}/bifrost.crt"
changed_when: false
when: cacerts | length > 0
become: "{{ container_engine == 'podman' }}"
- name: Copy CA certificate from Bifrost container
vars:
clouds: "{{ clouds_yaml.stdout | from_yaml }}"
cacerts: "{{ clouds.clouds.values() | selectattr('cacert', 'defined') | map(attribute='cacert') | list }}"
command:
cmd: "{{ container_engine }} cp bifrost_deploy:{{ cacerts[0] }} {{ openstack_config_dir }}/bifrost.crt"
changed_when: false
when: cacerts | length > 0
become: "{{ container_engine == 'podman' }}"

View File

@@ -20,3 +20,4 @@
inspector_rule_var_deploy_kernel: "{{ kolla_bifrost_inspector_deploy_kernel }}"
inspector_rule_var_deploy_ramdisk: "{{ kolla_bifrost_inspector_deploy_ramdisk }}"
inspector_rule_var_legacy_deploy_kernel: "{{ kolla_bifrost_inspector_legacy_deploy_kernel }}"
when: kolla_enable_bifrost | bool

View File

@@ -4,6 +4,9 @@
###############################################################################
# Bifrost installation.
# Whether to install Bifrost. Default is true.
#kolla_enable_bifrost:
# URL of Bifrost source code repository.
#kolla_bifrost_source_url:

View File

@@ -284,6 +284,7 @@
#kolla_enable_aodh:
#kolla_enable_barbican:
#kolla_enable_bifrost:
#kolla_enable_blazar:
#kolla_enable_ceilometer:
#kolla_enable_ceilometer_horizon_policy_file:

View File

@@ -0,0 +1,5 @@
---
features:
- |
Add `kolla_enable_bifrost` to make deploying Bifrost optional. It
defaults to `true` maintaining the current behavior.