Add configuration for seed hypervisor
Currently supports configuration of: - Local networking - NTP - Libvirt storage pools and networks
This commit is contained in:
parent
a82047f14f
commit
f76f244a38
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure development tools are installed
|
- name: Ensure development tools are installed
|
||||||
hosts: seed:overcloud
|
hosts: seed-hypervisor:seed:overcloud
|
||||||
roles:
|
roles:
|
||||||
- role: dev-tools
|
- role: dev-tools
|
||||||
|
54
ansible/group_vars/all/seed-hypervisor
Normal file
54
ansible/group_vars/all/seed-hypervisor
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
###############################################################################
|
||||||
|
# Seed hypervisor network interface configuration.
|
||||||
|
|
||||||
|
# List of default networks to which seed hypervisor nodes are attached.
|
||||||
|
seed_hypervisor_default_network_interfaces: "{{ seed_default_network_interfaces }}"
|
||||||
|
|
||||||
|
# List of extra networks to which seed hypervisor nodes are attached.
|
||||||
|
seed_hypervisor_extra_network_interfaces: "{{ seed_extra_network_interfaces }}"
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Seed hypervisor libvirt storage pool configuration.
|
||||||
|
|
||||||
|
# List of libvirt storage pools for the seed hypervisor.
|
||||||
|
seed_hypervisor_libvirt_pools:
|
||||||
|
- "{{ seed_hypervisor_libvirt_pool }}"
|
||||||
|
|
||||||
|
# Libvirt storage pool for the seed VM.
|
||||||
|
seed_hypervisor_libvirt_pool:
|
||||||
|
name: "{{ seed_hypervisor_libvirt_pool_name }}"
|
||||||
|
type: dir
|
||||||
|
capacity: "{{ seed_hypervisor_libvirt_pool_capacity }}"
|
||||||
|
path: "{{ seed_hypervisor_libvirt_pool_path }}"
|
||||||
|
mode: "{{ seed_hypervisor_libvirt_pool_mode }}"
|
||||||
|
owner: "{{ seed_hypervisor_libvirt_pool_owner }}"
|
||||||
|
group: "{{ seed_hypervisor_libvirt_pool_group }}"
|
||||||
|
|
||||||
|
# Name of the libvirt storage pool for the seed VM.
|
||||||
|
seed_hypervisor_libvirt_pool_name: "default"
|
||||||
|
|
||||||
|
# Capacity of the libvirt storage pool for the seed VM.
|
||||||
|
seed_hypervisor_libvirt_pool_capacity: "{{ 75 * 2**30 }}"
|
||||||
|
|
||||||
|
# Directory path of the libvirt storage pool for the seed VM.
|
||||||
|
seed_hypervisor_libvirt_pool_path: "/var/lib/libvirt/images"
|
||||||
|
|
||||||
|
# Directory mode of the libvirt storage pool for the seed VM.
|
||||||
|
seed_hypervisor_libvirt_pool_mode: 711
|
||||||
|
|
||||||
|
# Directory owner of the libvirt storage pool for the seed VM.
|
||||||
|
seed_hypervisor_libvirt_pool_owner: "root"
|
||||||
|
|
||||||
|
# Directory group of the libvirt storage pool for the seed VM.
|
||||||
|
seed_hypervisor_libvirt_pool_group: "root"
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Seed hypervisor libvirt network configuration.
|
||||||
|
|
||||||
|
# List of libvirt networks for the seed hypervisor.
|
||||||
|
seed_hypervisor_libvirt_networks: >
|
||||||
|
{{ network_interfaces |
|
||||||
|
net_select_bridges |
|
||||||
|
map('net_libvirt_network') |
|
||||||
|
list }}
|
8
ansible/group_vars/seed-hypervisor/network
Normal file
8
ansible/group_vars/seed-hypervisor/network
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
###############################################################################
|
||||||
|
# Network interface attachments.
|
||||||
|
|
||||||
|
# List of networks to which these nodes are attached.
|
||||||
|
network_interfaces: >
|
||||||
|
{{ (seed_hypervisor_default_network_interfaces +
|
||||||
|
seed_hypervisor_extra_network_interfaces) | unique | list }}
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure IP addresses are allocated
|
- name: Ensure IP addresses are allocated
|
||||||
hosts: seed:overcloud
|
hosts: seed-hypervisor:seed:overcloud
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Initialise the IP allocations fact
|
- name: Initialise the IP allocations fact
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure networking is configured
|
- name: Ensure networking is configured
|
||||||
hosts: seed:overcloud
|
hosts: seed-hypervisor:seed:overcloud
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
vars:
|
vars:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure NTP is installed and configured
|
- name: Ensure NTP is installed and configured
|
||||||
hosts: seed:overcloud
|
hosts: seed-hypervisor:seed:overcloud
|
||||||
roles:
|
roles:
|
||||||
- role: yatesr.timezone
|
- role: yatesr.timezone
|
||||||
become: True
|
become: True
|
||||||
|
7
ansible/seed-hypervisor-libvirt-host.yml
Normal file
7
ansible/seed-hypervisor-libvirt-host.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure the libvirt daemon is configured
|
||||||
|
hosts: seed-hypervisor
|
||||||
|
roles:
|
||||||
|
- role: libvirt-host
|
||||||
|
libvirt_host_pools: "{{ seed_hypervisor_libvirt_pools }}"
|
||||||
|
libvirt_host_networks: "{{ seed_hypervisor_libvirt_networks }}"
|
@ -40,6 +40,23 @@ The ``--enable-discovery`` argument enables a one-time configuration of ports
|
|||||||
attached to baremetal compute nodes to support hardware discovery via ironic
|
attached to baremetal compute nodes to support hardware discovery via ironic
|
||||||
inspector.
|
inspector.
|
||||||
|
|
||||||
|
Seed Hypervisor
|
||||||
|
===============
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
It is not necessary to run the seed services in a VM. To use an existing
|
||||||
|
bare metal host or a VM provisioned outside of Kayobe, this section may be
|
||||||
|
skipped.
|
||||||
|
|
||||||
|
Host Configuration
|
||||||
|
------------------
|
||||||
|
|
||||||
|
To configure the seed hypervisor's host OS, and the Libvirt/KVM virtualisation
|
||||||
|
support::
|
||||||
|
|
||||||
|
(kayobe-venv) $ kayobe seed hypervisor host configure
|
||||||
|
|
||||||
Seed
|
Seed
|
||||||
====
|
====
|
||||||
|
|
||||||
@ -48,7 +65,7 @@ VM Provisioning
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
It is not necesary to run the seed services in a VM. To use an existing
|
It is not necessary to run the seed services in a VM. To use an existing
|
||||||
bare metal host or a VM provisioned outside of Kayobe, this step may be
|
bare metal host or a VM provisioned outside of Kayobe, this step may be
|
||||||
skipped. Ensure that the Ansible inventory contains a host for the seed.
|
skipped. Ensure that the Ansible inventory contains a host for the seed.
|
||||||
|
|
||||||
|
46
etc/kayobe/seed-hypervisor.yml
Normal file
46
etc/kayobe/seed-hypervisor.yml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
###############################################################################
|
||||||
|
# Seed hypervisor network interface configuration.
|
||||||
|
|
||||||
|
# List of default networks to which seed hypervisor nodes are attached.
|
||||||
|
#seed_hypervisor_default_network_interfaces:
|
||||||
|
|
||||||
|
# List of extra networks to which seed hypervisor nodes are attached.
|
||||||
|
#seed_hypervisor_extra_network_interfaces:
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Seed hypervisor libvirt storage pool configuration.
|
||||||
|
|
||||||
|
# List of libvirt storage pools for the seed hypervisor.
|
||||||
|
#seed_hypervisor_libvirt_pools:
|
||||||
|
|
||||||
|
# Libvirt storage pool for the seed VM.
|
||||||
|
#seed_hypervisor_libvirt_pool:
|
||||||
|
|
||||||
|
# Name of the libvirt storage pool for the seed VM.
|
||||||
|
#seed_hypervisor_libvirt_pool_name:
|
||||||
|
|
||||||
|
# Capacity of the libvirt storage pool for the seed VM.
|
||||||
|
#seed_hypervisor_libvirt_pool_capacity:
|
||||||
|
|
||||||
|
# Directory path of the libvirt storage pool for the seed VM.
|
||||||
|
#seed_hypervisor_libvirt_pool_path:
|
||||||
|
|
||||||
|
# Directory mode of the libvirt storage pool for the seed VM.
|
||||||
|
#seed_hypervisor_libvirt_pool_mode:
|
||||||
|
|
||||||
|
# Directory owner of the libvirt storage pool for the seed VM.
|
||||||
|
#seed_hypervisor_libvirt_pool_owner:
|
||||||
|
|
||||||
|
# Directory group of the libvirt storage pool for the seed VM.
|
||||||
|
#seed_hypervisor_libvirt_pool_group:
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Seed hypervisor libvirt network configuration.
|
||||||
|
|
||||||
|
# List of libvirt networks for the seed hypervisor.
|
||||||
|
#seed_hypervisor_libvirt_networks:
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Dummy variable to allow Ansible to accept this file.
|
||||||
|
workaround_ansible_issue_8743: yes
|
@ -220,6 +220,19 @@ class PhysicalNetworkConfigure(KayobeAnsibleMixin, VaultMixin, Command):
|
|||||||
extra_vars=extra_vars)
|
extra_vars=extra_vars)
|
||||||
|
|
||||||
|
|
||||||
|
class SeedHypervisorHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin,
|
||||||
|
VaultMixin, Command):
|
||||||
|
"""Configure the seed hypervisor node host OS."""
|
||||||
|
|
||||||
|
def take_action(self, parsed_args):
|
||||||
|
self.app.LOG.debug("Configuring seed hypervisor host OS")
|
||||||
|
playbooks = _build_playbook_list(
|
||||||
|
"ip-allocation", "ssh-known-host", "dev-tools", "network", "ntp",
|
||||||
|
"seed-hypervisor-libvirt-host")
|
||||||
|
self.run_kayobe_playbooks(parsed_args, playbooks,
|
||||||
|
limit="seed-hypervisor")
|
||||||
|
|
||||||
|
|
||||||
class SeedVMProvision(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
|
class SeedVMProvision(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
|
||||||
Command):
|
Command):
|
||||||
"""Provision the seed VM."""
|
"""Provision the seed VM."""
|
||||||
|
2
setup.py
2
setup.py
@ -41,7 +41,6 @@ setup(
|
|||||||
provides=[],
|
provides=[],
|
||||||
install_requires=open('requirements.txt', 'rt').read().splitlines(),
|
install_requires=open('requirements.txt', 'rt').read().splitlines(),
|
||||||
|
|
||||||
|
|
||||||
namespace_packages=[],
|
namespace_packages=[],
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
@ -73,6 +72,7 @@ setup(
|
|||||||
'playbook_run = kayobe.cli.commands:PlaybookRun',
|
'playbook_run = kayobe.cli.commands:PlaybookRun',
|
||||||
'seed_container_image_build = kayobe.cli.commands:SeedContainerImageBuild',
|
'seed_container_image_build = kayobe.cli.commands:SeedContainerImageBuild',
|
||||||
'seed_host_configure = kayobe.cli.commands:SeedHostConfigure',
|
'seed_host_configure = kayobe.cli.commands:SeedHostConfigure',
|
||||||
|
'seed_hypervisor_host_configure = kayobe.cli.commands:SeedHypervisorHostConfigure',
|
||||||
'seed_service_deploy = kayobe.cli.commands:SeedServiceDeploy',
|
'seed_service_deploy = kayobe.cli.commands:SeedServiceDeploy',
|
||||||
'seed_vm_provision = kayobe.cli.commands:SeedVMProvision',
|
'seed_vm_provision = kayobe.cli.commands:SeedVMProvision',
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user