46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
---
|
|
- hosts: hypervisors
|
|
tasks:
|
|
- include_tasks: host_setup.yml
|
|
|
|
- hosts: controllers
|
|
tasks:
|
|
- include_tasks: schedule.yml
|
|
|
|
- name: Load allocations from file
|
|
include_vars:
|
|
file: "{{ allocations_file_path }}"
|
|
name: allocations
|
|
|
|
- hosts: hypervisors
|
|
tasks:
|
|
- include_tasks: vm_networking.yml
|
|
vars:
|
|
vm: "{{ item }}"
|
|
# Allocations are stored in the controller node's vars.
|
|
loop: >
|
|
{{ hostvars[groups.controllers.0].allocations.result[
|
|
inventory_hostname] | default([]) }}
|
|
|
|
- hosts: libvirt
|
|
tasks:
|
|
- include_role:
|
|
name: stackhpc.libvirt-host
|
|
vars:
|
|
libvirt_host_pools:
|
|
- name: "{{ libvirt_pool_name }}"
|
|
type: "{{ libvirt_pool_type }}"
|
|
capacity: "{{ libvirt_pool_capacity }}"
|
|
path: "{{ libvirt_pool_path }}"
|
|
mode: "{{ libvirt_pool_mode }}"
|
|
owner: "{{ libvirt_pool_owner }}"
|
|
group: "{{ libvirt_pool_group }}"
|
|
libvirt_host_require_vt: "{{ libvirt_require_vt }}"
|
|
|
|
- include_tasks: create_libvirt_vms.yml
|
|
vars:
|
|
# Allocations are stored in the controller node's vars.
|
|
vms: >
|
|
{{ hostvars[groups.controllers.0].allocations.result[
|
|
inventory_hostname] | default([]) }}
|