b05f02391c
This change enables 'zero touch' provisioning of the overcloud hosts. Following power on of the nodes, they are discovered by Ironic inspector running on the seed node and registered with the seed node's instance of Ironic. Once discovered and inspected, Kayobe uses the seed's Ironic inventory to populate its own Ansible inventory. From here, we can fill out host variables for Bifrost to use when provisioning the nodes. Finally, we configure Kolla Ansible's inventory.
36 lines
1.3 KiB
YAML
36 lines
1.3 KiB
YAML
---
|
|
# Gather an inventory of nodes from the seed's Ironic service. Use this to
|
|
# generate an Ansible inventory for Kayobe.
|
|
|
|
- name: Ensure the controller Ansible inventory is populated
|
|
hosts: seed
|
|
tasks:
|
|
- name: Gather the Ironic node inventory using Bifrost
|
|
command: >
|
|
docker exec bifrost_deploy
|
|
bash -c 'source /bifrost/env-vars &&
|
|
export BIFROST_INVENTORY_SOURCE=ironic &&
|
|
/bifrost/playbooks/inventory/bifrost_inventory.py'
|
|
register: inventory_result
|
|
changed_when: False
|
|
|
|
- name: Set a fact containing the Ironic node inventory
|
|
set_fact:
|
|
ironic_inventory: "{{ inventory_result.stdout | from_json }}"
|
|
|
|
- name: Ensure Kayobe controller inventory exists
|
|
local_action:
|
|
module: copy
|
|
content: |
|
|
# Managed by Ansible - do not edit.
|
|
# This is the Kayobe controller inventory, autogenerated from the seed
|
|
# node's Ironic inventory.
|
|
|
|
[controllers]
|
|
{% for host in ironic_inventory.baremetal.hosts %}
|
|
{% set hostvars=ironic_inventory._meta.hostvars[host] %}
|
|
{% set ipmi_address=hostvars.driver_info.ipmi_address | default %}
|
|
{{ host }} ipmi_address={{ ipmi_address }}
|
|
{% endfor %}
|
|
dest: "{{ kayobe_config_path }}/inventory/controllers"
|