nova_svirt¶
Role Documentation¶
Welcome to the “nova_svirt” role documentation.
Role Defaults¶
This section highlights all of the defaults and variables set within the “nova_svirt” role.
# All variables intended for modification should place placed in this file.
# All variables within this role should have a prefix of "nova_svirt"
nova_svirt_directory: /run/libvirt/qemu
Molecule Scenarios¶
Molecule is being used to test the “nova_svirt” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.
- Driver: podman
Scenario: default¶
Molecule Platform(s)¶
- name: centos
hostname: centos
image: centos/centos:stream8
registry:
url: quay.io
dockerfile: ../../../../.config/molecule/Dockerfile
pkg_extras: python*-setuptools python*-pyyaml
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
privileged: true
environment:
http_proxy: "{{ lookup('env', 'http_proxy') }}"
https_proxy: "{{ lookup('env', 'https_proxy') }}"
ulimits:
- host
Molecule Inventory¶
hosts:
all:
hosts:
centos:
ansible_python_interpreter: /usr/bin/python3
Example default playbook¶
- name: Converge
hosts: all
tasks:
- name: Run against a successful file
vars:
nova_svirt_directory: /libvirt/success
include_role:
name: nova_svirt
- name: Run against failed file
vars:
nova_svirt_directory: /libvirt/failure
block:
- name: Run the validation
include_role:
name: nova_svirt
rescue:
- name: Clear host errors
meta: clear_host_errors
- name: Success output
debug:
msg: Validation successfully detected the failure
- name: End play
meta: end_play
- name: Fail if we reach this point
fail:
msg: The validation did not detect the error