### Example oVirt Engine Setup Playbook Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/engine_setup/README.md An example Ansible playbook demonstrating the configuration of oVirt engine setup parameters. ```yaml --- ``` -------------------------------- ### Setup oVirt Repositories with Subscription Manager Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/repositories/README.md This playbook configures oVirt repositories by leveraging Red Hat Subscription Manager. It enables subscription management and forces system registration. The example assumes that the necessary subscription manager credentials (e.g., username, password) are available in the playbook's context or environment. ```yaml - name: Setup repositories using Subscription Manager hosts: localhost vars: ovirt_repositories_use_subscription_manager: True ovirt_repositories_force_register: True ovirt_repositories_rh_username: "{{ ovirt_repositories_rh_username }}" ``` -------------------------------- ### Enable and Start Services Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/DEV_HOSTED_ENGINE.md Enables and starts the libvirtd and nfs-server services, which are required for the hosted engine and NFS storage. ```bash systemctl enable --now libvirtd nfs-server ``` -------------------------------- ### Minimal Ansible Playbook for Hosted Engine Setup Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/DEV_HOSTED_ENGINE.md A basic Ansible playbook that applies the ovirt.ovirt.hosted_engine_setup role to the local host. ```yaml --- - hosts: localhost connection: local become: true roles: - ovirt.ovirt.hosted_engine_setup ``` -------------------------------- ### oVirt Engine Setup with Engine Configurations Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/engine_setup/README.md An Ansible playbook for setting up an oVirt engine with custom engine configurations. This example includes setting the SpiceProxyDefault configuration. ```yaml - name: Setup oVirt hosts: engine vars_files: # Contains encrypted `ovirt_engine_setup_admin_password` variable using ansible-vault - passwords.yml vars: ovirt_engine_setup_version: '4.5' ovirt_engine_setup_organization: 'of.ovirt.engine.com' ovirt_engine_setup_engine_configs: - key: SpiceProxyDefault value: prot://proxy version: general roles: - engine_setup collections: - ovirt.ovirt ``` -------------------------------- ### Setup oVirt Environment Playbook Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/disaster_recovery/README.md An example Ansible playbook to set up the oVirt environment for disaster recovery. It utilizes the disaster_recovery role and requires password and DR variable files. ```yaml --- - name: Setup oVirt environment hosts: localhost connection: local vars_files: - ovirt_passwords.yml - disaster_recovery_vars.yml roles: - disaster_recovery collections: - ovirt.ovirt ``` -------------------------------- ### Install Required Packages Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/DEV_HOSTED_ENGINE.md Installs necessary packages for the hosted engine setup, including Ansible core, NFS utilities, and the oVirt engine appliance. ```bash dnf install -y ansible-core nfs-utils ovirt-engine-appliance ``` -------------------------------- ### VM Infrastructure Role Configuration Example Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/vm_infra/README.md This example demonstrates how to configure the vm_infra role to deploy database and web server VMs with specific profiles and network configurations. It includes definitions for VM templates, memory, cores, disks, and network interfaces. ```yaml vars: engine_fqdn: ovirt-engine.example.com engine_user: admin@internal engine_cafile: /etc/pki/ovirt-engine/ca.pem httpd_vm: cluster: production domain: example.com template: rhel7 memory: 2GiB cores: 2 ssh_key: ssh-rsa AAA...LGx user@fqdn disks: - size: 10GiB name: data storage_domain: mynfsstorage interface: virtio db_vm: cluster: production domain: example.com template: rhel7 memory: 4GiB cores: 1 ssh_key: ssh-rsa AAA...LGx user@fqdn disks: - size: 50GiB name: data storage_domain: mynfsstorage interface: virtio nics: - name: ovirtmgmt network: ovirtmgmt profile: ovirtmgmt vms: - name: postgresql-vm-0 tag: postgresql_vm profile: "{{ db_vm }}" - name: postgresql-vm-1 tag: postgresql_vm profile: "{{ db_vm }}" - name: apache-vm tag: httpd_vm profile: "{{ httpd_vm }}" affinity_groups: - name: db-ag cluster: production vm_enforcing: true vm_rule: negative vms: - postgresql-vm-0 - postgresql-vm-1 roles: - vm_infra collections: - ovirt.ovirt ``` -------------------------------- ### Basic oVirt Engine Setup Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/engine_setup/README.md A standard Ansible playbook to set up an oVirt engine. Ensure 'passwords.yml' contains encrypted credentials. ```yaml - name: Setup oVirt hosts: engine vars_files: # Contains encrypted `ovirt_engine_setup_admin_password` variable using ansible-vault - passwords.yml vars: ovirt_engine_setup_version: '4.5' ovirt_engine_setup_organization: 'of.ovirt.engine.com' roles: - engine_setup collections: - ovirt.ovirt ``` -------------------------------- ### Install Required Ansible Collections Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/DEV_HOSTED_ENGINE.md Installs the 'ansible.posix' collection, which is a prerequisite for the hosted engine setup role. ```bash sudo ansible-galaxy collection install ansible.posix ``` -------------------------------- ### Example Playbook for Datacenter Cleanup Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/infra/roles/datacenter_cleanup/README.md This playbook demonstrates how to use the datacenter_cleanup role to remove a specific datacenter and format its storages. ```yaml - name: oVirt infra hosts: localhost connection: local gather_facts: false vars: data_center_name: mydatacenter format_storages: true roles: - ovirt.ovirt.infra.roles.datacenter_cleanup ``` -------------------------------- ### Configure oVirt Networks Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/infra/roles/networks/README.md Example playbook demonstrating the setup of oVirt logical and host networks using the networks role. It specifies network names, cluster assignments, VLAN tags, bonding configurations, and network interface settings. ```yaml - name: oVirt infra hosts: localhost connection: local gather_facts: false vars: logical_networks: - name: mynetwork clusters: - name: development assigned: yes required: no display: no migration: yes gluster: no host_networks: - name: myhost1 check: true save: true bond: name: bond0 mode: 2 interfaces: - eth2 - eth3 networks: - name: mynetwork boot_protocol: dhcp roles: - ovirt.ovirt.infra.roles.networks ``` -------------------------------- ### VM and Tag Inventory Example Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/vm_infra/README.md Defines virtual machines with names and tags, demonstrating how the role creates inventory groups for VMs and their assigned tags. ```yaml vms: - name: myvm1 tag: mytag1 profile: myprofile - name: myvm2 tag: mytag2 profile: myprofile ``` -------------------------------- ### Deploying Apache VM and Service Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/vm_infra/README.md This example shows how to deploy an Apache VM using the vm_infra role and then deploy Apache on that VM in a follow-up play. It utilizes inventory created by the vm_infra role. ```yaml --- - name: Deploy apache VM hosts: localhost connection: local gather_facts: false vars_files: # Contains encrypted `engine_password` varibale using ansible-vault - passwords.yml vars: wait_for_ip: true httpd_vm: cluster: production state: running domain: example.com template: rhel7 memory: 2GiB cores: 2 ssh_key: ssh-rsa AAA...LGx user@fqdn disks: - size: 10GiB name: data storage_domain: mynfsstorage interface: virtio vms: - name: apache-vm tag: apache profile: "{{ httpd_vm }}" roles: - vm_infra collections: - ovirt.ovirt - name: Deploy apache on VM hosts: ovirt_tag_apache vars_files: - apache_vars.yml roles: - geerlingguy.apache ``` -------------------------------- ### Run Hosted Engine Setup Playbook Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/DEV_HOSTED_ENGINE.md Executes the Ansible playbook to set up the hosted engine, using variables defined in a JSON file. ```bash sudo ansible-playbook test_playbook.yml -e @test_vars.json ``` -------------------------------- ### NFS Storage Setup Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/DEV_HOSTED_ENGINE.md Configures NFS storage by creating a directory, setting ownership, exporting the directory for local access, and reloading NFS exports. ```bash mkdir -p /exports/hosted-engine chown 36:36 /exports/hosted-engine echo "/exports/hosted-engine 127.0.0.1(rw,sync,no_root_squash)" >> /etc/exports exportfs -ra ``` -------------------------------- ### Changelog Fragment Example Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/changelogs/README.md An example of a changelog fragment showing a minor change related to ovirt_disk backup functionality. ```yaml --- minor_changes: - ovirt_disk - Add backup (https://github.com/oVirt/ovirt-ansible-collection/pull/57). ``` -------------------------------- ### Execute Disaster Recovery Failback Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/disaster_recovery/README.md Command to start the failback process, returning operations from the target setup back to the source setup. It uses the ovirt-dr script. ```bash $ ./ovirt-dr failback ``` -------------------------------- ### Setup Repositories with Satellite (Org/Activation Key) Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/repositories/README.md Sets up repositories with a Satellite server using organization ID and activation key for authentication. This method also allows configuration of CA RPM and certificate validation. ```yaml - name: Setup repositories using Subscription Manager with Satellite using org and activationkey hosts: localhost vars: ovirt_repositories_use_subscription_manager: true ovirt_repositories_org: "4fc82b1a-7d80-44cf-8ef6-affd8c6daa4f" ovirt_repositories_activationkey: "RHV_CDN_Host" ovirt_repositories_ca_rpm_url: https://example.com/pub/katello-ca-consumer-latest.noarch.rpm ovirt_repositories_ca_rpm_validate_certs: false ovirt_repositories_ca_rpm_disable_gpg_check: true ovirt_repositories_target_host: engine roles: - repositories collections: - ovirt.ovirt ``` -------------------------------- ### Configure oVirt External Providers Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/infra/roles/external_providers/README.md Example playbook demonstrating how to configure multiple oVirt external providers with different types and settings, including authentication keys for os_volume type. Use this to set up or remove providers. ```yaml - name: oVirt infra hosts: localhost connection: local gather_facts: false vars: external_providers: - name: myglance type: os_image state: present url: http://externalprovider.example.com:9292 username: admin password: secret tenant: admin auth_url: http://externalprovider.example.com:35357/v2.0 - name: mycinder type: os_volume state: present url: http://externalprovider.example.com:9292 username: admin password: secret tenant: admin auth_url: http://externalprovider.example.com:5000/v2.0 authentication_keys: - uuid: "1234567-a1234-12a3-a234-123abc45678" value: "ABCD00000000111111222333445w==" - name: public-glance type: os_image state: present url: http://glance.public.com:9292 - name: external-provider-to-be-removed type: os_image state: absent roles: - ovirt.ovirt.infra.roles.external_providers ``` -------------------------------- ### Setup Repositories with Satellite (Username/Password) Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/repositories/README.md Configures repositories using Subscription Manager with a Satellite server, authenticating via username and password. Includes options for CA RPM URL and certificate validation. ```yaml - name: Setup repositories using Subscription Manager with Satellite using username and password hosts: localhost vars: ovirt_repositories_use_subscription_manager: true ovirt_repositories_ca_rpm_url: https://example.com/pub/katello-ca-consumer-latest.noarch.rpm ovirt_repositories_ca_rpm_validate_certs: false ovirt_repositories_ca_rpm_disable_gpg_check: true ovirt_repositories_target_host: engine ovirt_repositories_rhsm_environment: Library ovirt_repositories_rh_password: "{{ ovirt_repositories_rh_password }}" ovirt_repositories_rh_username: "{{ ovirt_repositories_rh_username }}" ovirt_repositories_pool_ids: - 8aa508b87f922c3b017f97a785a40068 roles: - repositories collections: - ovirt.ovirt ``` -------------------------------- ### Install antsibull-nox for Linting and Testing Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/COLLECTION_README.md Installs the antsibull-nox tool, which is used for linting and running sanity tests for the collection. This is a prerequisite for testing the collection. ```bash pip install antsibull-nox ``` -------------------------------- ### Setup Repositories with Pool IDs Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/repositories/README.md Configures repositories using specific Subscription Manager pool IDs. Ensure the provided pool IDs are valid for your environment. ```yaml - name: Setup repositories using Subscription Manager pool name hosts: localhost vars: ovirt_repositories_use_subscription_manager: True ovirt_repositories_force_register: True ovirt_repositories_rh_username: "{{ ovirt_repositories_rh_username }}" ovirt_repositories_rh_password: "{{ ovirt_repositories_rh_password }}" ovirt_repositories_pool_ids: - 0123456789abcdef0123456789abcdef - 1123456789abcdef0123456789abcdef roles: - repositories collections: - ovirt.ovirt ``` -------------------------------- ### Configure oVirt Mac Pool Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/infra/roles/mac_pools/README.md Example playbook demonstrating how to set up a MAC pool named 'my_mac_pool' with a specific MAC address range and disallowing duplicates. ```yaml - name: oVirt set mac pool hosts: localhost connection: local gather_facts: false vars: mac_pools: - mac_pool_name: my_mac_pool mac_pool_allow_duplicates: false mac_pool_ranges: - 00:1a:4a:16:01:51,00:1a:4a:16:01:61 roles: - ovirt.ovirt.infra.roles.mac_pools ``` -------------------------------- ### Example oVirt Hosts Playbook Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/infra/roles/hosts/README.md This playbook demonstrates how to use the `ovirt.ovirt.infra.roles.hosts` role to configure oVirt hosts. It defines a list of hosts with their connection details and cluster assignments. ```yaml - name: oVirt infra hosts: localhost connection: local gather_facts: false vars: hosts: - name: myhost address: 1.2.3.4 cluster: production password: 123456 roles: - ovirt.ovirt.infra.roles.hosts ``` -------------------------------- ### Optional Custom Appliance Configuration Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/DEV_HOSTED_ENGINE.md Specifies a custom appliance image (OVA or qcow2) or an RPM package for the hosted engine setup. ```json { "he_appliance": "/path/to/appliance.[ova/qcow2]", "he_appliance_package": "/path/to/package.rpm", "he_appliance_package": "alternative-appliance-name" } ``` -------------------------------- ### Example Playbook for oVirt Permissions Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/infra/roles/permissions/README.md This playbook demonstrates how to use the permissions role to set up oVirt permissions for both users and groups. Ensure the 'ovirt.ovirt.infra.roles.permissions' role is correctly included in your playbook. ```yaml - name: oVirt infra hosts: localhost connection: local gather_facts: false vars: permissions: - state: present user_name: user1 authz_name: internal-authz role: UserRole object_type: cluster object_name: production - state: present group_name: group1 authz_name: internal-authz role: UserRole object_type: cluster object_name: production roles: - ovirt.ovirt.infra.roles.permissions ``` -------------------------------- ### Add oVirt Datacenter Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/infra/roles/datacenters/README.md Example playbook to add a new oVirt datacenter with specified name, description, local status, and compatibility version. ```yaml # Example 1 - name: Add oVirt datacenter hosts: localhost connection: local gather_facts: false vars: data_center_name: mydatacenter data_center_description: mydatacenter data_center_local: false compatibility_version: 4.4 roles: - ovirt.ovirt.infra.roles.datacenters ``` -------------------------------- ### Setup Repositories with Subscription Manager Pool Name Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/repositories/README.md Sets up repositories by specifying a human-readable pool name for Subscription Manager. This method requires valid RHN username and password. ```yaml - name: Setup repositories using Subscription Manager pool name hosts: localhost vars: ovirt_repositories_use_subscription_manager: True ovirt_repositories_force_register: True ovirt_repositories_rh_username: "{{ ovirt_repositories_rh_username }}" ovirt_repositories_rh_password: "{{ ovirt_repositories_rh_password }}" ovirt_repositories_pools: - "Red Hat Cloud Infrastructure, Premium (2-sockets)" roles: - repositories collections: - ovirt.ovirt ``` -------------------------------- ### oVirt Engine Setup Database Configuration Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/engine_setup/README.md Configure the PostgreSQL server for the oVirt Engine database. Options include host, port, name, user, and password. ```yaml ovirt_engine_setup_db_host: localhost ovirt_engine_setup_db_port: 5432 ovirt_engine_setup_db_name: engine ovirt_engine_setup_db_user: engine ovirt_engine_setup_db_password: UNDEF ovirt_engine_setup_engine_vacuum_full: False ``` -------------------------------- ### Example Playbook for oVirt Ansible Collection Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/COLLECTION_README.md A sample Ansible playbook demonstrating the use of the ovirt.ovirt collection to manage oVirt resources. It includes authentication and VM management tasks, with a block to ensure token revocation. ```yaml --- - name: ovirt ansible collection hosts: localhost connection: local vars_files: # Contains encrypted `engine_password` varibale using ansible-vault - passwords.yml tasks: - block: # The use of ovirt.ovirt before ovirt_auth is to check if the collection is correctly loaded - name: Obtain SSO token with using username/password credentials ovirt.ovirt.ovirt_auth: url: https://ovirt.example.com/ovirt-engine/api username: admin@internal ca_file: ca.pem password: "{{ ovirt_password }}" # Previous task generated I(ovirt_auth) fact, which you can later use # in different modules as follows: - ovirt_vm: auth: "{{ ovirt_auth }}" state: absent name: myvm always: - name: Always revoke the SSO token ovirt_auth: state: absent ovirt_auth: "{{ ovirt_auth }}" collections: - ovirt.ovirt ``` -------------------------------- ### Create oVirt Template from qcow Image Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/image_template/README.md This playbook creates an oVirt template from a qcow image. Ensure the 'ovirt.ovirt' collection is installed and the necessary variables like engine connection details and template specifications are defined. ```yaml --- - name: Create a template from qcow hosts: localhost connection: local gather_facts: false vars: engine_fqdn: ovirt-engine.example.com engine_user: admin@internal engine_password: 123456 engine_cafile: /etc/pki/ovirt-engine/ca.pem qcow_url: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 #qcow_url: file:///tmp/CentOS-7-x86_64-GenericCloud.qcow2 template_cluster: production template_name: centos7_template template_memory: 4GiB template_cpu: 2 template_disk_size: 10GiB template_disk_storage: mydata roles: - image_template collections: - ovirt.ovirt ``` -------------------------------- ### Example oVirt Cluster Upgrade Playbook Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/cluster_upgrade/README.md This playbook demonstrates how to use the cluster_upgrade role to upgrade hosts in an oVirt cluster. It configures necessary oVirt connection variables and specifies the cluster name and VMs to stop before the upgrade. ```yaml --- - name: oVirt infra hosts: localhost connection: local gather_facts: false vars: engine_fqdn: ovirt-engine.example.com engine_user: admin@internal engine_password: 123456 engine_cafile: /etc/pki/ovirt-engine/ca.pem cluster_name: production stopped_vms: - openshift-master-0 - openshift-node-0 - openshift-node-image roles: - cluster_upgrade collections: - ovirt.ovirt ``` -------------------------------- ### Setup oVirt Repositories with Release Package Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/repositories/README.md This playbook demonstrates how to set up oVirt repositories using a release RPM package. It includes a variable for the RPM URL and uses the 'repositories' role from the 'ovirt.ovirt' collection. Ensure 'passwords.yml' is properly configured if sensitive information is used. ```yaml --- - name: Setup repositories using oVirt release package hosts: localhost vars_files: # Contains encrypted `username` and `password` variables using ansible-vault - passwords.yml vars: ovirt_repositories_ovirt_release_rpm: http://resources.ovirt.org/pub/yum-repo/ovirt-master-release.rpm roles: - repositories collections: - ovirt.ovirt ``` -------------------------------- ### Install oVirt Ansible Collection Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/COLLECTION_README.md Installs the oVirt Ansible Collection from Ansible Galaxy. This is the recommended method for installation. ```bash $ ansible-galaxy collection install ovirt.ovirt ``` -------------------------------- ### oVirt Engine Setup OVN Provider Configuration Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/engine_setup/README.md Configure the OVN provider for oVirt engine setup. This is valid for oVirt Engine versions 4.2 and later. Options include username and password. ```yaml ovirt_engine_setup_provider_ovn_configure: True ovirt_engine_setup_provider_ovn_username: admin@internal ovirt_engine_setup_provider_ovn_password: UNDEF ``` -------------------------------- ### Example oVirt Infrastructure Playbook Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/infra/README.md This playbook demonstrates the configuration of various oVirt infrastructure components including MAC pools, clusters, hosts, storage domains, logical networks, users, groups, and permissions. It is intended for use with the oVirt Ansible collection. ```yaml --- - name: oVirt infra hosts: localhost connection: local gather_facts: false vars: engine_fqdn: ovirt-engine.example.com engine_user: admin@internal engine_password: 123456 engine_cafile: /etc/pki/ovirt-engine/ca.pem data_center_name: mydatacenter compatibility_version: 4.4 mac_pools: - mac_pool_name: "Default" mac_pool_ranges: - "00:1a:4a:16:01:51,00:1a:4a:16:01:61" clusters: - name: production cpu_type: Intel Conroe Family profile: production hosts: - name: myhost address: 1.2.3.4 cluster: production password: 123456 - name: myhost1 address: 5.6.7.8 cluster: production password: 123456 power_management: address: 9.8.7.6 username: root password: password type: ipmilan options: myoption1: x myoption2: y slot: myslot storages: mynfsstorage: master: true state: present nfs: address: 10.11.12.13 path: /the_path myiscsistorage: state: present iscsi: target: iqn.2014-07.org.ovirt:storage port: 3260 address: 100.101.102.103 username: username password: password lun_id: 3600140551fcc8348ea74a99b6760fbb4 mytemplates: domain_function: export nfs: address: 100.101.102.104 path: /exports/nfs/exported myisostorage: domain_function: iso nfs: address: 100.101.102.105 path: /exports/nfs/iso logical_networks: - name: mynetwork clusters: - name: production assigned: yes required: no display: no migration: yes gluster: no host_networks: - name: myhost1 check: true save: true bond: name: bond0 mode: 2 interfaces: - eth2 - eth3 networks: - name: mynetwork boot_protocol: dhcp users: - name: john.doe authz_name: internal-authz password: 123456 valid_to: "2018-01-01 00:00:00Z" - name: joe.doe authz_name: internal-authz password: 123456 valid_to: "2018-01-01 00:00:00Z" user_groups: - name: admins authz_name: internal-authz users: - john.doe - joe.doe permissions: - state: present user_name: john.doe authz_name: internal-authz role: UserROle object_type: cluster object_name: production - state: present group_name: admins ``` -------------------------------- ### Execute Disaster Recovery Failover Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/disaster_recovery/README.md Command to initiate the failover process to the target disaster recovery setup. It uses the ovirt-dr script. ```bash $ ./ovirt-dr failover ``` -------------------------------- ### Encrypted Passwords for Hosted Engine Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/hosted_engine_setup/README.md Example file for storing Hosted Engine passwords. This file can be encrypted using 'ansible-vault encrypt passwords.yml'. ```yaml --- # As an example this file is keep in plaintext, if you want to # encrypt this file, please execute following command: # # $ ansible-vault encrypt passwords.yml # # It will ask you for a password, which you must then pass to # ansible interactively when executing the playbook. # # $ ansible-playbook myplaybook.yml --ask-vault-pass # he_appliance_password: 123456 he_admin_password: 123456 ``` -------------------------------- ### oVirt Engine Setup Apache Configuration Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/engine_setup/README.md Configure Apache settings for the oVirt engine. Options include root redirection and SSL configuration. ```yaml ovirt_engine_setup_apache_config_root_redirection: True ovirt_engine_setup_apache_config_ssl: True ``` -------------------------------- ### Optional UEFI Boot Configuration Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/DEV_HOSTED_ENGINE.md Enables UEFI boot for the hosted engine VM by setting the 'he_use_uefi' variable to true. ```json { "he_use_uefi": true } ``` -------------------------------- ### Example Playbook for oVirt Storages Source: https://github.com/ovirt/ovirt-ansible-collection/blob/master/roles/infra/roles/storages/README.md This playbook demonstrates how to configure different types of oVirt storage domains, including NFS, iSCSI, export, and ISO, using the storages role. Ensure the 'storages' variable is correctly defined with the desired parameters for each storage domain. ```yaml - name: oVirt infra hosts: localhost connection: local gather_facts: false vars: storages: mynfsstorage: master: true state: present nfs: address: 1.2.3.4 path: /path myiscsistorage: state: present iscsi: target: iqn.2014-07.org.ovirt:storage port: 3260 address: 10.11.12.13 username: username password: password lun_id: 3600140551fcc8348ea74a99b6760fbb4 discard_after_delete: false myexporttemplates: domain_function: export nfs: address: 100.101.102.103 path: /templates myisostorage: domain_function: iso nfs: address: 111.222.111.222 path: /iso roles: - ovirt.ovirt.infra.roles.storages ```