
This commit adds simple roles to manage: - libvirt service, domains, volumes, networks and pools. - redfish-emulator role installs sushy-tools from pip, together with support packages Please note, that libvirt roles are not meant to be completely idempotent, their main job is deploy temporary resources that for ci and gating purposes, to be tore down afterwards. Roles are specifically made to be simple to debug, and don't contain any complex logic to make them portable, flexible or idempotent. Change-Id: I2ff0138b5c95bea3445e242a2e5061651498f1ab
33 lines
778 B
YAML
33 lines
778 B
YAML
# Description:
|
|
# Add given hosts to existing libvirt network
|
|
#
|
|
# Inputs:
|
|
# network_action: "add_dhcp_hosts"
|
|
# network_args:
|
|
# name: <name of network>
|
|
# hosts:
|
|
# - name:
|
|
# mac:
|
|
# ip:
|
|
# - name:
|
|
# mac:
|
|
# ip:
|
|
|
|
- name: Validate input
|
|
assert:
|
|
that:
|
|
- "network_args is defined"
|
|
- "network_args.name is defined"
|
|
- "network_args.hosts is defined"
|
|
- "network_args.hosts | list"
|
|
|
|
- name: add dhcp hosts to network
|
|
shell: >-
|
|
virsh net-update {{ network_args.name }} \
|
|
add --section ip-dhcp-host \
|
|
--xml "<host mac='{{ single_dhcp_host.mac}}' ip='{{ single_dhcp_host.name }}'/>" \
|
|
--config --live
|
|
loop: "{{ network_args.hosts }}"
|
|
loop_control:
|
|
loop_var: single_dhcp_host
|