kayobe/ansible/kolla-bifrost.yml

47 lines
1.9 KiB
YAML

---
- name: Ensure Kolla Bifrost is configured
hosts: config-mgmt
vars:
kolla_bifrost_extra_globals_path: "{{ kayobe_config_path ~ '/kolla/config/bifrost/bifrost.yml' }}"
kolla_bifrost_driver_map:
- { name: agent_ipmitool, enabled: "{{ kolla_bifrost_enable_ipmitool_drivers | bool }}" }
pre_tasks:
- name: Fail if not running in a virtualenv
fail:
msg: >
This playbook should be executed from a virtualenv in order to avoid
installing python packages to the system location. Typically this
will be named 'kayobe-venv'
when: "{{ not lookup('env', 'VIRTUAL_ENV') }}"
- name: Check whether a Kolla Bifrost extra globals configuration file exists
stat:
path: "{{ kolla_bifrost_extra_globals_path }}"
get_checksum: False
get_md5: False
mime: False
register: globals_stat
- name: Read the Kolla Bifrost extra globals configuration file
set_fact:
kolla_bifrost_extra_globals: "{{ lookup('template', kolla_bifrost_extra_globals_path) | from_yaml }}"
when: globals_stat.stat.exists
roles:
- role: kolla-bifrost
kolla_bifrost_venv: "{{ lookup('env', 'VIRTUAL_ENV') }}"
# Generate a list of enabled drivers from the map.
kolla_bifrost_enabled_drivers: >
{{ kolla_bifrost_driver_map | selectattr('enabled') | map(attribute='name') | list }}
kolla_bifrost_enable_pxe_drivers: false
# Network configuration.
kolla_bifrost_dhcp_pool_start: "{{ provision_oc_net_name | net_inspection_allocation_pool_start }}"
kolla_bifrost_dhcp_pool_end: "{{ provision_oc_net_name | net_inspection_allocation_pool_end }}"
kolla_bifrost_dnsmasq_router: "{{ provision_oc_net_name | net_gateway }}"
kolla_bifrost_dnsmasq_dns_servers: "{{ resolv_nameservers | default([]) }}"
kolla_bifrost_domain: "{{ resolv_domain | default }}"