
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
788 B
YAML
33 lines
788 B
YAML
- name: Include test variables.
|
|
include_vars:
|
|
file: vars.yml
|
|
- name: install libvirt
|
|
include_role:
|
|
name: libvirt-install
|
|
- name: create pool
|
|
include_role:
|
|
name: libvirt-pool
|
|
vars:
|
|
ansible_become: true
|
|
- name: Create defined volumes
|
|
include_role:
|
|
name: libvirt-volume
|
|
with_items: "{{ libvirt_volumes }}"
|
|
vars:
|
|
libvirt_volume: "{{ vol }}"
|
|
volume_action: "{{ vol.action }}"
|
|
ansible_become: true
|
|
loop_control:
|
|
loop_var: vol
|
|
- name: save volume list
|
|
command: virsh vol-list --pool {{ libvirt_pool.name }}
|
|
register: libvirt_pool_list
|
|
changed_when: false
|
|
become: true
|
|
- name: verify volumes exist
|
|
assert:
|
|
that:
|
|
- "vol.name in libvirt_pool_list.stdout"
|
|
with_items: "{{ libvirt_volumes }}"
|
|
loop_control:
|
|
loop_var: vol |