Init: mediaserver

This commit is contained in:
2023-02-08 12:13:28 +01:00
parent 848bc9739c
commit f7c23d4ba9
31914 changed files with 6175775 additions and 0 deletions

View File

@@ -0,0 +1,659 @@
=========================
ovirt.ovirt Release Notes
=========================
.. contents:: Topics
v2.4.1
======
Bugfixes
--------
- cluster_upgrade - Fix the engine_correlation_id location (https://github.com/oVirt/ovirt-ansible-collection/pull/637).
v2.4.0
======
Bugfixes
--------
- cluster_upgrade - Add default random uuid to engine_correlation_id (https://github.com/oVirt/ovirt-ansible-collection/pull/624).
- image_template - Add template_bios_type (https://github.com/oVirt/ovirt-ansible-collection/pull/620).
v2.3.1
======
Bugfixes
--------
- filters - Fix ovirtvmipsv4 with attribute and network (https://github.com/oVirt/ovirt-ansible-collection/pull/607).
- filters - Fix ovirtvmipsv4 with filter to list (https://github.com/oVirt/ovirt-ansible-collection/pull/609).
- ovirt_host - Fix kernel_params elemets type (https://github.com/oVirt/ovirt-ansible-collection/pull/608).
v2.3.0
======
Minor Changes
-------------
- filters - Add documentation to all filters (https://github.com/oVirt/ovirt-ansible-collection/pull/603).
- ovirt_disk - Add read_only param for disk attachments (https://github.com/oVirt/ovirt-ansible-collection/pull/597).
- ovirt_disk - Fix disk attachment to VM (https://github.com/oVirt/ovirt-ansible-collection/pull/361).
Bugfixes
--------
- Fix ovirtvmipsv4 when using attribute (https://github.com/oVirt/ovirt-ansible-collection/pull/596).
- he-setup - fix static ipv6 ifcfg setup (https://github.com/oVirt/ovirt-ansible-collection/pull/592).
- ovirt_host - Honor activate and reboot_after_installation when they are set to false with reinstalled host state (https://github.com/oVirt/ovirt-ansible-collection/pull/587).
- repositories - RHV 4.4 SP1 is supported only on RHEL 8.6 EUS (https://github.com/oVirt/ovirt-ansible-collection/pull/576).
v2.2.3
======
Minor Changes
-------------
- hosted_engine_setup - fix ovirt-provider-ovn-driver broken link (https://github.com/oVirt/ovirt-ansible-collection/pull/581).
Bugfixes
--------
- cluster_upgrade - skip host upgrades without anything to update (https://github.com/oVirt/ovirt-ansible-collection/pull/580).
- hosted_engine_setup - restore - remove host also based on name (https://github.com/oVirt/ovirt-ansible-collection/pull/567).
- repositories - Fix example variable names (https://github.com/oVirt/ovirt-ansible-collection/pull/582).
v2.2.2
======
Bugfixes
--------
- hosted_engine_setup - Detect hosted-engine-ha version using /usr/libexec/platform-python (https://github.com/oVirt/ovirt-ansible-collection/pull/573).
- hosted_engine_setup - update ansible version in README (https://github.com/oVirt/ovirt-ansible-collection/pull/571).
- repositories - Add mod_auth_openidc:2.3 and nodejs:14 to dnf modules (https://github.com/oVirt/ovirt-ansible-collection/pull/578).
v2.2.1
======
Minor Changes
-------------
- During he_setup, configure ovn with he_host_address (https://github.com/oVirt/ovirt-ansible-collection/pull/568).
Bugfixes
--------
- hosted_engine_setup - fix hosted-engine.conf permissions and ownership (https://github.com/oVirt/ovirt-ansible-collection/pull/569).
v2.2.0
======
Minor Changes
-------------
- During he_setup, configure ovn with he_host_name for correct operation of ovn (https://github.com/oVirt/ovirt-ansible-collection/pull/563).
- Fix "ansible-lint" version 6.0.0 "yaml" violations for "disaster_recovery" role (https://github.com/oVirt/ovirt-ansible-collection/pull/543).
- Fix "ansible-lint" version 6.0.0 violations for "disaster_recovery" & "remove_stale_lun" roles (https://github.com/oVirt/ovirt-ansible-collection/pull/554).
- Fix ansible-lint for basic roles (https://github.com/oVirt/ovirt-ansible-collection/pull/280).
- Updating the documentation - "vm_name" / "vm_id" and/or disk "id" parameter(s) are required when extending disk with non-unique name (https://github.com/oVirt/ovirt-ansible-collection/pull/559).
- gluster_heal_info - Replacing gluster module to CLI to support RHV automation hub (https://github.com/oVirt/ovirt-ansible-collection/pull/340).
- ovirt_disk - Add warning for disk attachments (https://github.com/oVirt/ovirt-ansible-collection/pull/347).
- ovirt_disk - Fix disk attachment to VM (https://github.com/oVirt/ovirt-ansible-collection/pull/361).
- ovirt_qos, ovirt_disk_profile, ovirt_disk - Add modules to allow for creation and updating of disk_profiles (https://github.com/oVirt/ovirt-ansible-collection/pull/422).
- ovirt_snapshot - Add vm_id to select VM (https://github.com/oVirt/ovirt-ansible-collection/pull/550).
- ovirt_vm - Add reset of VM (https://github.com/oVirt/ovirt-ansible-collection/pull/538).
- ovirt_vm - Add virtio_scsi_enabled and multi_queues_enabled (https://github.com/oVirt/ovirt-ansible-collection/pull/348).
- ovirt_vm - add volatile (https://github.com/oVirt/ovirt-ansible-collection/pull/539).
- repositories - Add ovirt_repositories_rhsm_environment and FIPS fix (https://github.com/oVirt/ovirt-ansible-collection/pull/483).
- repositories - Replace redhat_subscription and rhsm_repository with command (https://github.com/oVirt/ovirt-ansible-collection/pull/346).
Bugfixes
--------
- HE - Handle migration to hosts that use systemd-coredump (https://github.com/oVirt/ovirt-ansible-collection/pull/557).
- cluster_upgrade - Fix starting up pinned vms (https://github.com/oVirt/ovirt-ansible-collection/pull/532).
- he - Align role with ansible-lint-6.0 (https://github.com/oVirt/ovirt-ansible-collection/pull/545).
- hosted_engine - Specify fqcn for ovirt_system_option_info (https://github.com/oVirt/ovirt-ansible-collection/pull/536).
- hosted_engine_setup - Fix cleanup on el9 (https://github.com/oVirt/ovirt-ansible-collection/pull/533).
- image_template - Remove static (https://github.com/oVirt/ovirt-ansible-collection/pull/537).
- image_template - Remove static no - unsupported in ansible 2.12 (https://github.com/oVirt/ovirt-ansible-collection/pull/341).
- ovirt_host - Fix host wait (https://github.com/oVirt/ovirt-ansible-collection/pull/531).
- ovirt_host - Fix restarted wait condition (https://github.com/oVirt/ovirt-ansible-collection/pull/551).
- ovirt_storage_domain - Fix inaccessible exception (https://github.com/oVirt/ovirt-ansible-collection/pull/534).
- ovirt_vm - check if user inputed graphical protocol (https://github.com/oVirt/ovirt-ansible-collection/pull/542).
- repositories - Move fips check to satellite CA install block (https://github.com/oVirt/ovirt-ansible-collection/pull/553).
- shutdown_env - Align role with ansible-lint-6.0 (https://github.com/oVirt/ovirt-ansible-collection/pull/544).
v2.1.0
======
Minor Changes
-------------
- Add convert_to_bytes filter (https://github.com/oVirt/ovirt-ansible-collection/pull/515).
- automation - Use python38 on el8 with ansible-core 2.12 and python39 on el9 with ansible-core 2.13 (https://github.com/oVirt/ovirt-ansible-collection/pull/518).
- cloud.py - Sync with orgin (https://github.com/oVirt/ovirt-ansible-collection/pull/519).
- engine_setup - Allow to disable cert validation (https://github.com/oVirt/ovirt-ansible-collection/pull/517).
- hosted_engine_setup - make vdsm config cleanup optional (https://github.com/oVirt/ovirt-ansible-collection/pull/521).
- ovirt - Remove deprecated distutils (https://github.com/oVirt/ovirt-ansible-collection/pull/516).
- ovirt_vm - add wait_after_lease (https://github.com/oVirt/ovirt-ansible-collection/pull/524).
Bugfixes
--------
- hosted_engine_setup - Fix "'ansible' ModuleNotFoundError" in Disaster Recovery scripts (https://github.com/oVirt/ovirt-ansible-collection/pull/503).
- hosted_engine_setup - Use command instead of firewalld module (https://github.com/oVirt/ovirt-ansible-collection/pull/508).
- ovirt_vm - Fix parsing None arguments (https://github.com/oVirt/ovirt-ansible-collection/pull/486).
- ovirt_vm - check if the snapshot exists (https://github.com/oVirt/ovirt-ansible-collection/pull/525).
v2.0.4
======
Bugfixes
--------
- Fix the admin user name when using keycloak (https://github.com/oVirt/ovirt-ansible-collection/pull/488).
- Use cryptography < 37.0.0, as 37.0.0 emits a warning that fails testing. (https://github.com/oVirt/ovirt-ansible-collection/pull/492).
- Use rstcheck < 3.5.0, as 3.5.0 emits a warning that fails testing. (https://github.com/oVirt/ovirt-ansible-collection/pull/490).
- cluster_upgrade - fix wait_condition (https://github.com/oVirt/ovirt-ansible-collection/pull/510).
- hosted_engine_setup - Allocate 128MiB instead of 1GiB for he_metadata (https://github.com/oVirt/ovirt-ansible-collection/pull/489).
- hosted_engine_setup - Collect logs also on failures in 03_hosted_engine_final_tasks.yml (https://github.com/oVirt/ovirt-ansible-collection/pull/504).
- hosted_engine_setup - Fix keycloak activation/checking (https://github.com/oVirt/ovirt-ansible-collection/pull/509).
- hosted_engine_setup - Require 'detail' to be 'Up' (https://github.com/oVirt/ovirt-ansible-collection/pull/498).
- hosted_engine_setup - fix archive ownership (https://github.com/oVirt/ovirt-ansible-collection/pull/501).
- infra - add warning for multiple storage connections (https://github.com/oVirt/ovirt-ansible-collection/pull/500).
v2.0.3
======
Minor Changes
-------------
- ovirt_affinity_group - Add affinity labels (https://github.com/oVirt/ovirt-ansible-collection/pull/481).
Bugfixes
--------
- invenory - Fix url address (https://github.com/oVirt/ovirt-ansible-collection/pull/482).
- ovirt_vm - Fix creating a RAW VM from a COW template (https://github.com/oVirt/ovirt-ansible-collection/pull/466).
v2.0.2
======
Bugfixes
--------
- Fix progress logging via REST (https://github.com/oVirt/ovirt-ansible-collection/pull/474).
v2.0.1
======
Bugfixes
--------
- Make storage_format optional - do not fail if missing (https://github.com/oVirt/ovirt-ansible-collection/pull/471).
v2.0.0
======
Major Changes
-------------
- manageiq - role removed (https://github.com/oVirt/ovirt-ansible-collection/pull/375).
Minor Changes
-------------
- Add json_query filter (https://github.com/oVirt/ovirt-ansible-collection/pull/436).
- cluster_upgrade - Add progress tracking via event logs to the role (https://github.com/oVirt/ovirt-ansible-collection/pull/415)
- cluster_upgrade - Directly log progress to the cluster (https://github.com/oVirt/ovirt-ansible-collection/pull/449)
- engine_setup - Honor ovirt_engine_setup_offline variable (https://github.com/oVirt/ovirt-ansible-collection/pull/381).
- engine_setup - Prepare answer files and default values for 4.5 release (https://github.com/oVirt/ovirt-ansible-collection/pull/414).
- gluster_heal_info - Replacing gluster module to CLI to support RHV automation hub (https://github.com/oVirt/ovirt-ansible-collection/pull/340).
- hosted_engine - Replace virt_net and xml with commands (https://github.com/oVirt/ovirt-ansible-collection/pull/359).
- hosted_engine_setup - Fix default gateway variable name (https://github.com/oVirt/ovirt-ansible-collection/pull/423).
- hosted_engine_setup - Fix default gateway variable name (https://github.com/oVirt/ovirt-ansible-collection/pull/423).
- hosted_engine_setup - Fix permissions on copied engine logs, needed for OpenSCAP (https://github.com/oVirt/ovirt-ansible-collection/pull/404).
- hosted_engine_setup - Honor he_offline_deployment variable (https://github.com/oVirt/ovirt-ansible-collection/pull/380).
- hosted_engine_setup - Replace calls to psql as postgres with engine_psql.sh (https://github.com/oVirt/ovirt-ansible-collection/pull/453).
- hosted_engine_setup - configured abrt initial files only when needed (https://github.com/oVirt/ovirt-ansible-collection/pull/397).
- info - Rename follows to follow parameter and add alias (https://github.com/oVirt/ovirt-ansible-collection/pull/367).
- info - bump deprecate version for fetch_nested and nested_attributes (https://github.com/oVirt/ovirt-ansible-collection/pull/378).
- info modules - Add follow link url to api model links_summary
- info modules - Enable follow parameter (https://github.com/oVirt/ovirt-ansible-collection/pull/355).
- manageiq - add deprecation info (https://github.com/oVirt/ovirt-ansible-collection/pull/384).
- ovirt_disk - Add warning for disk attachments (https://github.com/oVirt/ovirt-ansible-collection/pull/347).
- ovirt_disk - Use imageio client (https://github.com/oVirt/ovirt-ansible-collection/pull/358).
- ovirt_event - enable correlation_id on events (https://github.com/oVirt/ovirt-ansible-collection/pull/368).
- ovirt_host - Add enroll_certificate (https://github.com/oVirt/ovirt-ansible-collection/pull/439).
- ovirt_permission - add mac pool (https://github.com/oVirt/ovirt-ansible-collection/pull/353).
- ovirt_remove_stale_lun - Allow user to remove multiple LUNs (https://github.com/oVirt/ovirt-ansible-collection/pull/357).
- ovirt_remove_stale_lun - Retry "multipath -f" while removing the LUNs (https://github.com/oVirt/ovirt-ansible-collection/pull/382).
- ovirt_remove_stale_lun - Use add_host instead of delegate_to (https://github.com/oVirt/ovirt-ansible-collection/pull/390).
- ovirt_storage_template_info - fix docs (https://github.com/oVirt/ovirt-ansible-collection/pull/356).
- ovirt_storage_vm_info - fix docs (https://github.com/oVirt/ovirt-ansible-collection/pull/356).
- ovirt_template - Add ova import of template (https://github.com/oVirt/ovirt-ansible-collection/pull/304).
- ovirt_template - add boot_menu and bios_type https://github.com/oVirt/ovirt-ansible-collection/pull/465).
- ovirt_vm - Add display file_transfer_enabled and copy_paste_enabled (https://github.com/oVirt/ovirt-ansible-collection/pull/339).
- ovirt_vm - Add virtio_scsi_enabled and multi_queues_enabled (https://github.com/oVirt/ovirt-ansible-collection/pull/348).
- ovirt_vm - Add virtio_scsi_multi_queues (https://github.com/oVirt/ovirt-ansible-collection/pull/373).
- plugins - Remove unused imports (https://github.com/oVirt/ovirt-ansible-collection/pull/444).
- repositories - Add to the documentation variable priority (https://github.com/oVirt/ovirt-ansible-collection/pull/440).
- repositories - Replace redhat_subscription and rhsm_repository with command (https://github.com/oVirt/ovirt-ansible-collection/pull/346).
- repositories - Update host and engine repositories to 4.4.9 (https://github.com/oVirt/ovirt-ansible-collection/pull/363).
- repositories - add no_log to register (https://github.com/oVirt/ovirt-ansible-collection/pull/350).
- repositories - add satelite support (https://github.com/oVirt/ovirt-ansible-collection/pull/431).
- vm_infra - Add no_log to Manage VMs state task (https://github.com/oVirt/ovirt-ansible-collection/pull/417).
Bugfixes
--------
- hosted_engine_setup - Add OpenSCAP security profile name parameter (https://github.com/oVirt/ovirt-ansible-collection/pull/411).
- hosted_engine_setup - Add an option to set the storage format when createing a storage domain and use it (https://github.com/oVirt/ovirt-ansible-collection/pull/463).
- hosted_engine_setup - Adjust files permissions (https://github.com/oVirt/ovirt-ansible-collection/pull/409).
- hosted_engine_setup - Fix call to engine-psql for vds_spm_id (https://github.com/oVirt/ovirt-ansible-collection/pull/459).
- hosted_engine_setup - Fix cloud-init package removal in airgapped environment (https://github.com/oVirt/ovirt-ansible-collection/pull/442)
- hosted_engine_setup - Remove SPICE graphic protocol (https://github.com/oVirt/ovirt-ansible-collection/pull/394).
- hosted_engine_setup - Replace xml community module (https://github.com/oVirt/ovirt-ansible-collection/pull/438).
- hosted_engine_setup - Support disa stig profile (https://github.com/oVirt/ovirt-ansible-collection/pull/426).
- hosted_engine_setup - Use cat command (https://github.com/oVirt/ovirt-ansible-collection/pull/443).
- hosted_engine_setup - Use tpgt in iscsi login (https://github.com/oVirt/ovirt-ansible-collection/pull/338)
- image_template - Remove static no - unsupported in ansible 2.12 (https://github.com/oVirt/ovirt-ansible-collection/pull/341).
- ovirt_host - Fix failed_state_after_reinstall condition (https://github.com/oVirt/ovirt-ansible-collection/pull/371).
- ovirt_template - Fix creating templates where the base template version number is not 1 (https://github.com/oVirt/ovirt-ansible-collection/pull/370).
- repositories - Fix dnf module variable (https://github.com/oVirt/ovirt-ansible-collection/pull/454).
- repositories - fix force flag on subscription-manager (https://github.com/oVirt/ovirt-ansible-collection/pull/430).
New Plugins
-----------
Callback
~~~~~~~~
- ovirt.ovirt.stdout - Output the log of ansible
v1.6.2
======
Minor Changes
-------------
- remove_stale_lun - Fix example for `remote_stale_lun` role to be able to run it from engine (https://github.com/oVirt/ovirt-ansible-collection/pull/334).
v1.6.1
======
Bugfixes
--------
- hosted_engine_setup - Use default bridge for IPv6 advertisements (https://github.com/oVirt/ovirt-ansible-collection/pull/331)
- ovirt_auth - Fix token no_log (https://github.com/oVirt/ovirt-ansible-collection/pull/332).
v1.5.5
======
Major Changes
-------------
- remove_stale_lun - Add role for removing stale LUN (https://bugzilla.redhat.com/1966873).
Minor Changes
-------------
- engine_setup - Wait for webserver up after engine-config reboot (https://github.com/oVirt/ovirt-ansible-collection/pull/324).
- hosted_engine_setup - Pause deployment on failure of `engine-backup --mode=restore` (https://github.com/oVirt/ovirt-ansible-collection/pull/327).
- hosted_engine_setup - Text change - Consistently use 'bootstrap engine VM' (https://github.com/oVirt/ovirt-ansible-collection/pull/328).
- hosted_engine_setup - Update Ansible requirements in README (https://github.com/oVirt/ovirt-ansible-collection/pull/321)
- readme - Update Ansible requirement (https://github.com/oVirt/ovirt-ansible-collection/pull/326).
Bugfixes
--------
- ovirt_auth - Fix password and username requirements (https://github.com/oVirt/ovirt-ansible-collection/pull/325).
- ovirt_disk - Fix update_check with no VM (https://github.com/oVirt/ovirt-ansible-collection/pull/323).
v1.5.4
======
Minor Changes
-------------
- hosted_engine_setup - Allow FIPS on HE VM (https://github.com/oVirt/ovirt-ansible-collection/pull/313)
Bugfixes
--------
- hosted_engine_setup - Use forward network during an IPv6 deployment (https://github.com/oVirt/ovirt-ansible-collection/pull/315)
- hosted_engine_setup - remove duplicate tasks (https://github.com/oVirt/ovirt-ansible-collection/pull/314)
- ovirt_permission - fix group search that has space in it's name (https://github.com/oVirt/ovirt-ansible-collection/pull/318)
v1.5.3
======
Minor Changes
-------------
- Don't rely on safe_eval being able to do math/concat (https://github.com/oVirt/ovirt-ansible-collection/pull/307)
- hosted_engine_setup - Fix engine vm add_host for the target machine (https://github.com/oVirt/ovirt-ansible-collection/pull/311)
- hosted_engine_setup - Minor doc update (https://github.com/oVirt/ovirt-ansible-collection/pull/310)
v1.5.2
======
Minor Changes
-------------
- hosted_engine_setup - Do not try to sync at end of full_execution (https://github.com/oVirt/ovirt-ansible-collection/pull/305)
- ovirt_vm - Add default return value to check_placement_policy (https://github.com/oVirt/ovirt-ansible-collection/pull/301).
v1.5.1
======
Minor Changes
-------------
- hosted_engine_setup - use-ansible-host (https://github.com/oVirt/ovirt-ansible-collection/pull/277).
- infra role - Add external_provider parameter on networks role of infra role (https://github.com/oVirt/ovirt-ansible-collection/pull/297)
- ovirt_vm - Add placement_policy_hosts (https://github.com/oVirt/ovirt-ansible-collection/pull/294).
Bugfixes
--------
- hosted_engine_setup - Filter VLAN devices with bad names (https://github.com/oVirt/ovirt-ansible-collection/pull/238)
- hosted_engine_setup - Remove cloud-init configuration (https://github.com/oVirt/ovirt-ansible-collection/pull/295).
- ovirt inventory plugin - allow several valid values for the `plugin` key (https://github.com/oVirt/ovirt-ansible-collection/pull/293).
v1.5.0
======
Minor Changes
-------------
- disaster_recovery - Change conf paths (https://github.com/oVirt/ovirt-ansible-collection/pull/286).
- hosted_engine_setup - Add-pause-option-before-engine-setup (https://github.com/oVirt/ovirt-ansible-collection/pull/273).
- hosted_engine_setup - Remove leftover code and omit parameters (https://github.com/oVirt/ovirt-ansible-collection/pull/281).
- infra - Storage fix parameters typo (https://github.com/oVirt/ovirt-ansible-collection/pull/282).
- ovirt_host - Update iscsi target struct (https://github.com/oVirt/ovirt-ansible-collection/pull/274).
Bugfixes
--------
- hosted_engine_setup - Use ovirt_host module to discover iscsi (https://github.com/oVirt/ovirt-ansible-collection/pull/275).
- hosted_engine_setup - align with ansible-lint 5.0.0 (https://github.com/oVirt/ovirt-ansible-collection/pull/271).
v1.4.2
======
Minor Changes
-------------
- hosted_engine_setup - Add an error message for FIPS on CentOS (https://github.com/oVirt/ovirt-ansible-collection/pull/250).
- hosted_engine_setup - Fix the appliance distribution (https://github.com/oVirt/ovirt-ansible-collection/pull/249).
- infra - remove target from ovirt_storage_connection (https://github.com/oVirt/ovirt-ansible-collection/pull/252).
- ovirt_vm - Allow migration between clusters (https://github.com/oVirt/ovirt-ansible-collection/pull/236).
- repositories - Add host ppc (https://github.com/oVirt/ovirt-ansible-collection/pull/248).
- repositories - Remove ansible channels from RHV 4.4 (https://github.com/oVirt/ovirt-ansible-collection/pull/242).
- repositories - fix ppc repos (https://github.com/oVirt/ovirt-ansible-collection/pull/254).
v1.4.1
======
Bugfixes
--------
- hosted_engine_setup - Fix auth revoke (https://github.com/oVirt/ovirt-ansible-collection/pull/237).
v1.4.0
======
Minor Changes
-------------
- cluster_upgrade - Add correlation-id header (https://github.com/oVirt/ovirt-ansible-collection/pull/222).
- engine_setup - Add skip renew pki confirm (https://github.com/oVirt/ovirt-ansible-collection/pull/228).
- examples - Add recipe for removing DM device (https://github.com/oVirt/ovirt-ansible-collection/pull/233).
- hosted_engine_setup - Filter devices with unsupported bond mode (https://github.com/oVirt/ovirt-ansible-collection/pull/226).
- infra - Add reboot host parameters (https://github.com/oVirt/ovirt-ansible-collection/pull/231).
- ovirt_disk - Add SATA support (https://github.com/oVirt/ovirt-ansible-collection/pull/225).
- ovirt_user - Add ssh_public_key (https://github.com/oVirt/ovirt-ansible-collection/pull/232)
Bugfixes
--------
- Set ``auth`` options into argument spec definition so Ansible will validate the user options
- Set ``no_log`` on ``password`` and ``token`` in the ``auth`` dict so the values are exposed in the invocation log
v1.3.1
======
Minor Changes
-------------
- hosted_engine_setup - Disable reboot_after_installation (https://github.com/oVirt/ovirt-ansible-collection/pull/218).
- ovirt_host - Add reboot_after_installation option (https://github.com/oVirt/ovirt-ansible-collection/pull/217).
v1.3.0
======
Major Changes
-------------
- ovirt_system_option_info - Add new module (https://github.com/oVirt/ovirt-ansible-collection/pull/206).
Minor Changes
-------------
- ansible-builder - Update bindep (https://github.com/oVirt/ovirt-ansible-collection/pull/197).
- hosted_engine_setup - Collect all engine /var/log (https://github.com/oVirt/ovirt-ansible-collection/pull/202).
- hosted_engine_setup - Use ovirt_system_option_info instead of REST API (https://github.com/oVirt/ovirt-ansible-collection/pull/209).
- ovirt_disk - Add install warning (https://github.com/oVirt/ovirt-ansible-collection/pull/208).
- ovirt_info - Fragment add auth suboptions to documentation (https://github.com/oVirt/ovirt-ansible-collection/pull/205).
v1.2.4
======
Minor Changes
-------------
- infra - don't require passowrd for user (https://github.com/oVirt/ovirt-ansible-collection/pull/195).
- inventory - correct os_type name (https://github.com/oVirt/ovirt-ansible-collection/pull/194).
- ovirt_disk - automatically detect virtual size of qcow image (https://github.com/oVirt/ovirt-ansible-collection/pull/183).
v1.2.3
======
Minor Changes
-------------
- engine_setup - Add missing restore task file and vars file (https://github.com/oVirt/ovirt-ansible-collection/pull/180).
- hosted_engine_setup - Add after_add_host hook (https://github.com/oVirt/ovirt-ansible-collection/pull/181).
v1.2.2
======
Bugfixes
--------
- hosted_engine_setup - Clean VNC encryption config (https://github.com/oVirt/ovirt-ansible-collection/pull/175/).
- inventory plugin - Fix timestamp for Python 2 (https://github.com/oVirt/ovirt-ansible-collection/pull/173).
v1.2.1
======
Bugfixes
--------
- disaster_recovery - Fix multiple configuration issues like paths, "~" support, user input messages, etc. (https://github.com/oVirt/ovirt-ansible-collection/pull/160).
v1.2.0
======
Major Changes
-------------
- cluster_upgrade - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/94).
- disaster_recovery - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/134).
- engine_setup - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/69).
- hosted_engine_setup - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/106).
- image_template - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/95).
- infra - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/92).
- manageiq - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/97).
- repositories - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/96).
- shutdown_env - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/112).
- vm_infra - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/93).
Minor Changes
-------------
- Add GPL license (https://github.com/oVirt/ovirt-ansible-collection/pull/101).
- hosted_engine_setup - Add compatibility_version (https://github.com/oVirt/ovirt-ansible-collection/pull/125).
- ovirt_disk - ignore move of HE disks (https://github.com/oVirt/ovirt-ansible-collection/pull/162).
- ovirt_nic - Add template_version (https://github.com/oVirt/ovirt-ansible-collection/pull/145).
- ovirt_nic_info - Add template (https://github.com/oVirt/ovirt-ansible-collection/pull/146).
- ovirt_vm_info - Add current_cd (https://github.com/oVirt/ovirt-ansible-collection/pull/144).
Bugfixes
--------
- 01_create_target_hosted_engine_vm - Force basic authentication (https://github.com/oVirt/ovirt-ansible-collection/pull/131).
- hosted_engine_setup - Allow uppercase characters in mac address (https://github.com/oVirt/ovirt-ansible-collection/pull/150).
- hosted_engine_setup - set custom bios type of hosted-engine VM to Q35+SeaBIOS (https://github.com/oVirt/ovirt-ansible-collection/pull/129).
- hosted_engine_setup - use zcat instead of gzip (https://github.com/oVirt/ovirt-ansible-collection/pull/130).
- ovirt inventory - Add close of connection at the end (https://github.com/oVirt/ovirt-ansible-collection/pull/122).
- ovirt_disk - dont move disk when already in storage_domain (https://github.com/oVirt/ovirt-ansible-collection/pull/135)
- ovirt_disk - fix upload when direct upload fails (https://github.com/oVirt/ovirt-ansible-collection/pull/120).
- ovirt_vm - Fix template search (https://github.com/oVirt/ovirt-ansible-collection/pull/132).
- ovirt_vm - Rename q35_sea to q35_sea_bios (https://github.com/oVirt/ovirt-ansible-collection/pull/111).
v1.1.2
======
v1.1.1
======
Minor Changes
-------------
- ovirt_permission - Fix FQCN documentation (https://github.com/oVirt/ovirt-ansible-collection/pull/63).
v1.1.0
======
Major Changes
-------------
- ovirt_disk - Add backup (https://github.com/oVirt/ovirt-ansible-collection/pull/57).
- ovirt_disk - Support direct upload/download (https://github.com/oVirt/ovirt-ansible-collection/pull/35).
- ovirt_host - Add ssh_port (https://github.com/oVirt/ovirt-ansible-collection/pull/60).
- ovirt_vm_os_info - Creation of module (https://github.com/oVirt/ovirt-ansible-collection/pull/26).
Minor Changes
-------------
- ovirt inventory - Add creation_time (https://github.com/oVirt/ovirt-ansible-collection/pull/34).
- ovirt inventory - Set inventory plugin insecure if no cafile defined (https://github.com/oVirt/ovirt-ansible-collection/pull/58).
- ovirt_disk - Add upload image warning for correct format (https://github.com/oVirt/ovirt-ansible-collection/pull/22).
- ovirt_disk - Force wait when uploading disk (https://github.com/oVirt/ovirt-ansible-collection/pull/43).
- ovirt_disk - Upload_image_path autodetect size (https://github.com/oVirt/ovirt-ansible-collection/pull/19).
- ovirt_network - Add support of removing vlan_tag (https://github.com/oVirt/ovirt-ansible-collection/pull/21).
- ovirt_vm - Add documentation for custom_script under sysprep (https://github.com/oVirt/ovirt-ansible-collection/pull/52).
- ovirt_vm - Hard code nic on_boot to true (https://github.com/oVirt/ovirt-ansible-collection/pull/45).
Bugfixes
--------
- ovirt_disk - Fix activate (https://github.com/oVirt/ovirt-ansible-collection/pull/61).
- ovirt_host_network - Fix custom_properties default value (https://github.com/oVirt/ovirt-ansible-collection/pull/65).
- ovirt_quota - Fix vcpu_limit (https://github.com/oVirt/ovirt-ansible-collection/pull/44).
- ovirt_vm - Fix cd_iso get all disks from storage domains (https://github.com/oVirt/ovirt-ansible-collection/pull/66).
- ovirt_vm - Fix cd_iso search by name (https://github.com/oVirt/ovirt-ansible-collection/pull/51).
New Modules
-----------
- ovirt.ovirt.ovirt_vm_os_info - Retrieve information on all supported oVirt/RHV operating systems
v1.0.0
======
Minor Changes
-------------
- ovirt_cluster - Add migration_encrypted option (https://github.com/oVirt/ovirt-ansible-collection/pull/17).
- ovirt_vm - Add bios_type (https://github.com/oVirt/ovirt-ansible-collection/pull/15).
Bugfixes
--------
- ovirt_snapshot - Disk id was incorrectly set as disk_snapshot_id (https://github.com/oVirt/ovirt-ansible-collection/pull/5).
- ovirt_storage_domain - Fix update_check warning_low_space (https://github.com/oVirt/ovirt-ansible-collection/pull/10).
- ovirt_vm - Remove deprecated warning of boot params (https://github.com/oVirt/ovirt-ansible-collection/pull/3).
New Plugins
-----------
Inventory
~~~~~~~~~
- ovirt.ovirt.ovirt - oVirt inventory source
New Modules
-----------
- ovirt.ovirt.ovirt_affinity_group - Module to manage affinity groups in oVirt/RHV
- ovirt.ovirt.ovirt_affinity_label - Module to manage affinity labels in oVirt/RHV
- ovirt.ovirt.ovirt_affinity_label_info - Retrieve information about one or more oVirt/RHV affinity labels
- ovirt.ovirt.ovirt_api_info - Retrieve information about the oVirt/RHV API
- ovirt.ovirt.ovirt_auth - Module to manage authentication to oVirt/RHV
- ovirt.ovirt.ovirt_cluster - Module to manage clusters in oVirt/RHV
- ovirt.ovirt.ovirt_cluster_info - Retrieve information about one or more oVirt/RHV clusters
- ovirt.ovirt.ovirt_datacenter - Module to manage data centers in oVirt/RHV
- ovirt.ovirt.ovirt_datacenter_info - Retrieve information about one or more oVirt/RHV datacenters
- ovirt.ovirt.ovirt_disk - Module to manage Virtual Machine and floating disks in oVirt/RHV
- ovirt.ovirt.ovirt_disk_info - Retrieve information about one or more oVirt/RHV disks
- ovirt.ovirt.ovirt_event - Create or delete an event in oVirt/RHV
- ovirt.ovirt.ovirt_event_info - This module can be used to retrieve information about one or more oVirt/RHV events
- ovirt.ovirt.ovirt_external_provider - Module to manage external providers in oVirt/RHV
- ovirt.ovirt.ovirt_external_provider_info - Retrieve information about one or more oVirt/RHV external providers
- ovirt.ovirt.ovirt_group - Module to manage groups in oVirt/RHV
- ovirt.ovirt.ovirt_group_info - Retrieve information about one or more oVirt/RHV groups
- ovirt.ovirt.ovirt_host - Module to manage hosts in oVirt/RHV
- ovirt.ovirt.ovirt_host_info - Retrieve information about one or more oVirt/RHV hosts
- ovirt.ovirt.ovirt_host_network - Module to manage host networks in oVirt/RHV
- ovirt.ovirt.ovirt_host_pm - Module to manage power management of hosts in oVirt/RHV
- ovirt.ovirt.ovirt_host_storage_info - Retrieve information about one or more oVirt/RHV HostStorages (applicable only for block storage)
- ovirt.ovirt.ovirt_instance_type - Module to manage Instance Types in oVirt/RHV
- ovirt.ovirt.ovirt_job - Module to manage jobs in oVirt/RHV
- ovirt.ovirt.ovirt_mac_pool - Module to manage MAC pools in oVirt/RHV
- ovirt.ovirt.ovirt_network - Module to manage logical networks in oVirt/RHV
- ovirt.ovirt.ovirt_network_info - Retrieve information about one or more oVirt/RHV networks
- ovirt.ovirt.ovirt_nic - Module to manage network interfaces of Virtual Machines in oVirt/RHV
- ovirt.ovirt.ovirt_nic_info - Retrieve information about one or more oVirt/RHV virtual machine network interfaces
- ovirt.ovirt.ovirt_permission - Module to manage permissions of users/groups in oVirt/RHV
- ovirt.ovirt.ovirt_permission_info - Retrieve information about one or more oVirt/RHV permissions
- ovirt.ovirt.ovirt_quota - Module to manage datacenter quotas in oVirt/RHV
- ovirt.ovirt.ovirt_quota_info - Retrieve information about one or more oVirt/RHV quotas
- ovirt.ovirt.ovirt_role - Module to manage roles in oVirt/RHV
- ovirt.ovirt.ovirt_scheduling_policy_info - Retrieve information about one or more oVirt scheduling policies
- ovirt.ovirt.ovirt_snapshot - Module to manage Virtual Machine Snapshots in oVirt/RHV
- ovirt.ovirt.ovirt_snapshot_info - Retrieve information about one or more oVirt/RHV virtual machine snapshots
- ovirt.ovirt.ovirt_storage_connection - Module to manage storage connections in oVirt
- ovirt.ovirt.ovirt_storage_domain - Module to manage storage domains in oVirt/RHV
- ovirt.ovirt.ovirt_storage_domain_info - Retrieve information about one or more oVirt/RHV storage domains
- ovirt.ovirt.ovirt_storage_template_info - Retrieve information about one or more oVirt/RHV templates relate to a storage domain.
- ovirt.ovirt.ovirt_storage_vm_info - Retrieve information about one or more oVirt/RHV virtual machines relate to a storage domain.
- ovirt.ovirt.ovirt_tag - Module to manage tags in oVirt/RHV
- ovirt.ovirt.ovirt_tag_info - Retrieve information about one or more oVirt/RHV tags
- ovirt.ovirt.ovirt_template - Module to manage virtual machine templates in oVirt/RHV
- ovirt.ovirt.ovirt_template_info - Retrieve information about one or more oVirt/RHV templates
- ovirt.ovirt.ovirt_user - Module to manage users in oVirt/RHV
- ovirt.ovirt.ovirt_user_info - Retrieve information about one or more oVirt/RHV users
- ovirt.ovirt.ovirt_vm - Module to manage Virtual Machines in oVirt/RHV
- ovirt.ovirt.ovirt_vm_info - Retrieve information about one or more oVirt/RHV virtual machines
- ovirt.ovirt.ovirt_vmpool - Module to manage VM pools in oVirt/RHV
- ovirt.ovirt.ovirt_vmpool_info - Retrieve information about one or more oVirt/RHV vmpools
- ovirt.ovirt.ovirt_vnic_profile - Module to manage vNIC profile of network in oVirt/RHV
- ovirt.ovirt.ovirt_vnic_profile_info - Retrieve information about one or more oVirt/RHV vnic profiles

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
{
"collection_info": {
"namespace": "ovirt",
"name": "ovirt",
"version": "2.4.1",
"authors": [
"Martin Necas <mnecas@redhat.com>"
],
"readme": "README.md",
"tags": [
"collection",
"infrastructure",
"linux",
"cloud",
"virtualization"
],
"description": "The oVirt Ansible Collection.",
"license": [
"Apache-2.0",
"GPL-3.0-or-later"
],
"license_file": null,
"dependencies": {},
"repository": "https://github.com/ovirt/ovirt-ansible-collection",
"documentation": null,
"homepage": "https://www.ovirt.org/",
"issues": "https://github.com/ovirt/ovirt-ansible-collection/issues"
},
"file_manifest_file": {
"name": "FILES.json",
"ftype": "file",
"chksum_type": "sha256",
"chksum_sha256": "0f934b63081cc9b57b257cf97ac3e56698357a8b724fe2ba426459ddeb7b1620",
"format": 1
},
"format": 1
}

View File

@@ -0,0 +1,4 @@
README for developers
====================================
You can find all information around [development](https://github.com/oVirt/ovirt-ansible-collection/wiki/Development) or [project structure](https://github.com/oVirt/ovirt-ansible-collection/wiki/Project-structure) in [wiki](https://github.com/oVirt/ovirt-ansible-collection/wiki).

View File

@@ -0,0 +1,27 @@
[![Copr build status](https://copr.fedorainfracloud.org/coprs/ovirt/ovirt-master-snapshot/package/ovirt-ansible-collection/status_image/last_build.png)](https://copr.fedorainfracloud.org/coprs/ovirt/ovirt-master-snapshot/package/ovirt-ansible-collection/)
[![Build Status](https://img.shields.io/badge/docs-latest-blue.svg)](https://docs.ansible.com/ansible/2.10/collections/ovirt/ovirt/index.html)
oVirt Ansible Collection
====================================
Requirements
------------
* Ansible core version 2.12.0 or higher
* Python SDK version 4.5.0 or higher
* Python netaddr library on the ansible controller node
Upstream oVirt documentation
--------------
https://docs.ansible.com/ansible/latest/collections/ovirt/ovirt/index.html
Downstream RHV documentation
--------------
https://cloud.redhat.com/ansible/automation-hub/redhat/rhv
Licenses
-------
- Apache License 2.0
- GNU General Public License 3.0

View File

@@ -0,0 +1,88 @@
[![Build Status](https://jenkins.ovirt.org/job/oVirt_ovirt-ansible-collection_standard-check-pr/badge/icon)](https://jenkins.ovirt.org/job/oVirt_ovirt-ansible-collection_standard-check-pr/)
[![Build Status](https://img.shields.io/badge/docs-latest-blue.svg)](https://docs.ansible.com/ansible/2.10/collections/ovirt/ovirt/index.html)
oVirt Ansible Collection
====================================
The `ovirt.ovirt` manages all oVirt Ansible modules.
The pypi installation is no longer supported if you want
to install all dependencies do it manually or install the
collection from RPM and it will be done automatically.
Note
----
Please note that when installing this collection from Ansible Galaxy you are instructed to run following command:
```bash
$ ansible-galaxy collection install ovirt.ovirt
```
Requirements
------------
* Ansible core version 2.12.0 or higher
* Python SDK version 4.5.0 or higher
* Python netaddr library on the ansible controller node
Content of the collection
----------------
* modules:
* ovirt_* - Modules to manage objects in ovirt Engine
* ovirt_*_info - Modules to gather information about objects in ovirt Engine
* roles:
* cluster_upgrade
* engine_setup
* hosted_engine_setup
* image_template
* infra
* repositories
* shutdown_env
* vm_infra
* disaster_recovery
* inventory plugin
Example Playbook
----------------
```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
```
Licenses
-------
- Apache License 2.0
- GNU General Public License 3.0

View File

@@ -0,0 +1,8 @@
Continuous Integration Scripts
==============================
This directory contains scripts for Continuous Integration provided by
[oVirt Jenkins](http://jenkins.ovirt.org/)
system and follows the standard defined in
[Build and test standards](http://www.ovirt.org/CI/Build_and_test_standards)
wiki page.

View File

@@ -0,0 +1,78 @@
#!/bin/bash -xe
ROOT_PATH="$PWD"
BUILD_ROOT_PATH="/tmp"
# Remove any previous artifacts
rm -rf "$BUILD_ROOT_PATH/ansible_collections"
rm -f "$BUILD_ROOT_PATH"/*tar.gz
# Create exported-artifacts dir
[[ -d exported-artifacts ]] || mkdir "$ROOT_PATH/exported-artifacts/"
# Create builds
./build.sh build ovirt "$BUILD_ROOT_PATH"
./build.sh build rhv "$BUILD_ROOT_PATH"
OVIRT_BUILD="$BUILD_ROOT_PATH/ansible_collections/ovirt/ovirt"
RHV_BUILD="$BUILD_ROOT_PATH/ansible_collections/redhat/rhv"
cd "$OVIRT_BUILD"
# Create the src.rpm
rpmbuild \
-D "_srcrpmdir $BUILD_ROOT_PATH/output" \
-D "_topmdir $BUILD_ROOT_PATH/rpmbuild" \
-ts ./*.gz
# Remove the tarball so it will not be included in galaxy build
mv ./*.gz "$ROOT_PATH/exported-artifacts/"
# Overwrite github README with dynamic
mv ./README.md.in ./README.md
# Create tar for galaxy
ansible-galaxy collection build
# Create the rpms
rpmbuild \
-D "_rpmdir $BUILD_ROOT_PATH/output" \
-D "_topmdir $BUILD_ROOT_PATH/rpmbuild" \
--rebuild "$BUILD_ROOT_PATH"/output/*.src.rpm
cd "$RHV_BUILD"
# Remove the tarball so it will not be included in automation hub build
rm -rf ./*.gz
# Overwrite github README with dynamic
mv ./README.md.in ./README.md
# create tar for automation hub
ansible-galaxy collection build
# Store any relevant artifacts in exported-artifacts for the ci system to
# archive
find "$BUILD_ROOT_PATH/output" -iname \*rpm -exec mv "{}" "$ROOT_PATH/exported-artifacts/" \;
# Export build for Ansible Galaxy
mv "$OVIRT_BUILD"/*tar.gz "$ROOT_PATH/exported-artifacts/"
# Export build for Automation Hub
mv "$RHV_BUILD"/*tar.gz "$ROOT_PATH/exported-artifacts/"
COLLECTION_DIR="/usr/local/share/ansible/collections/ansible_collections/ovirt/ovirt"
export ANSIBLE_LIBRARY="$COLLECTION_DIR/plugins/modules"
mkdir -p $COLLECTION_DIR
cp -r "$OVIRT_BUILD"/* "$OVIRT_BUILD"/.config "$COLLECTION_DIR"
cd "$COLLECTION_DIR"
antsibull-changelog lint -v
ansible-lint roles/*
cd "$ROOT_PATH"
# If PR changed something in ./plugins or ./roles it is required to have changelog
if [[ $(git diff --quiet HEAD^ ./plugins ./roles)$? -eq 1 && $(git diff --quiet HEAD^ ./changelogs)$? -eq 0 ]]; then
echo "ERROR: Please add changelog.";
exit 1;
fi

View File

@@ -0,0 +1,6 @@
gcc [compile platform:centos-8 platform:rhel-8]
libcurl-devel [compile platform:centos-8 platform:rhel-8]
libxml2-devel [compile platform:centos-8 platform:rhel-8]
openssl-devel [compile platform:centos-8 platform:rhel-8]
python38-devel [compile platform:centos-8 platform:rhel-8]
qemu-img [platform:centos-8 platform:rhel-8]

View File

@@ -0,0 +1,77 @@
#!/bin/bash
VERSION="2.4.1"
MILESTONE=""
RPM_RELEASE="1"
BUILD_TYPE=$2
BUILD_PATH=$3
if [[ $BUILD_TYPE = "rhv" ]]; then
COLLECTION_NAMESPACE="redhat"
COLLECTION_NAME="rhv"
else
COLLECTION_NAMESPACE="ovirt"
COLLECTION_NAME="ovirt"
fi
PACKAGE_NAME="ovirt-ansible-collection"
PREFIX=/usr/local
DATAROOT_DIR=$PREFIX/share
COLLECTIONS_DATAROOT_DIR=$DATAROOT_DIR/ansible/collections/ansible_collections
DOC_DIR=$DATAROOT_DIR/doc
PKG_DATA_DIR=${PKG_DATA_DIR:-$COLLECTIONS_DATAROOT_DIR}
PKG_DATA_DIR_ORIG=${PKG_DATA_DIR_ORIG:-$PKG_DATA_DIR}
PKG_DOC_DIR=${PKG_DOC_DIR:-$DOC_DIR/$PACKAGE_NAME}
RPM_VERSION=$VERSION
PACKAGE_VERSION=$VERSION
[ -n "$MILESTONE" ] && PACKAGE_VERSION+="_$MILESTONE"
TARBALL="$PACKAGE_NAME-$PACKAGE_VERSION.tar.gz"
dist() {
echo "Creating tar archive '$TARBALL' ... "
sed \
-e "s|@RPM_VERSION@|$RPM_VERSION|g" \
-e "s|@RPM_RELEASE@|$RPM_RELEASE|g" \
-e "s|@PACKAGE_NAME@|$PACKAGE_NAME|g" \
-e "s|@PACKAGE_VERSION@|$PACKAGE_VERSION|g" \
< ovirt-ansible-collection.spec.in > ovirt-ansible-collection.spec
find ./* -not -name '*.spec' -type f | tar --files-from /proc/self/fd/0 -czf "$TARBALL" ovirt-ansible-collection.spec
echo "tar archive '$TARBALL' created."
}
install() {
echo "Installing data..."
mkdir -p "$PKG_DATA_DIR/$COLLECTION_NAMESPACE/$COLLECTION_NAME"
mkdir -p "$PKG_DOC_DIR"
cp -pR plugins/ roles/ "$PKG_DATA_DIR/$COLLECTION_NAMESPACE/$COLLECTION_NAME"
if [[ $BUILD_TYPE = "rhv" ]]; then
echo "Creating link to ovirt.ovirt"
mkdir -p "$PKG_DATA_DIR/ovirt"
ln -f -s "$PKG_DATA_DIR_ORIG/redhat/rhv" "$PKG_DATA_DIR/ovirt/ovirt"
fi
echo "Installation done."
}
rename() {
echo "Renaming ovirt to $COLLECTION_NAMESPACE and ovirt to $COLLECTION_NAME"
find ./* -type f -exec sed -i -e "s/ovirt/$COLLECTION_NAMESPACE/g" -e "s/ovirt/$COLLECTION_NAME/g" {} \;
}
build() {
if [[ $BUILD_PATH ]]; then
BUILD_PATH="$BUILD_PATH/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME/"
mkdir -p "$BUILD_PATH"
echo "The copying files to $BUILD_PATH"
cp -r ./* .config/ "$BUILD_PATH"
cd "$BUILD_PATH"
rename
dist
fi
}
$1

View File

@@ -0,0 +1,28 @@
# Fragments
## Content of fragmnet
### Example
```yaml
---
minor_changes:
- ovirt_disk - Add backup (https://github.com/oVirt/ovirt-ansible-collection/pull/57).
```
### Types
- major_changes
- minor_changes
- bugfixes
- breaking_changes
- deprecated_features
- removed_features
- security_fixes
## Commands
`antsibull-changelog lint`
`antsibull-changelog release`

View File

@@ -0,0 +1,897 @@
ancestor: null
releases:
1.0.0:
changes:
bugfixes:
- ovirt_snapshot - Disk id was incorrectly set as disk_snapshot_id (https://github.com/oVirt/ovirt-ansible-collection/pull/5).
- ovirt_storage_domain - Fix update_check warning_low_space (https://github.com/oVirt/ovirt-ansible-collection/pull/10).
- ovirt_vm - Remove deprecated warning of boot params (https://github.com/oVirt/ovirt-ansible-collection/pull/3).
minor_changes:
- ovirt_cluster - Add migration_encrypted option (https://github.com/oVirt/ovirt-ansible-collection/pull/17).
- ovirt_vm - Add bios_type (https://github.com/oVirt/ovirt-ansible-collection/pull/15).
fragments:
- 10-ovirt_storage_domain-fix-update_check-warning_low_space.yaml
- 15-ovirt_vm-add-bios_type.yaml
- 17-ovirt_cluster-add-migration_encrypted.yaml
- 3-ovirt_vm-remove-deprecated-warning-boot-params.yaml
- 5-ovirt_snapshot-disk id-was-incorrectly set-as-disk_snapshot_id.yaml
modules:
- description: Module to manage affinity groups in oVirt/RHV
name: ovirt_affinity_group
namespace: ''
- description: Module to manage affinity labels in oVirt/RHV
name: ovirt_affinity_label
namespace: ''
- description: Retrieve information about one or more oVirt/RHV affinity labels
name: ovirt_affinity_label_info
namespace: ''
- description: Retrieve information about the oVirt/RHV API
name: ovirt_api_info
namespace: ''
- description: Module to manage authentication to oVirt/RHV
name: ovirt_auth
namespace: ''
- description: Module to manage clusters in oVirt/RHV
name: ovirt_cluster
namespace: ''
- description: Retrieve information about one or more oVirt/RHV clusters
name: ovirt_cluster_info
namespace: ''
- description: Module to manage data centers in oVirt/RHV
name: ovirt_datacenter
namespace: ''
- description: Retrieve information about one or more oVirt/RHV datacenters
name: ovirt_datacenter_info
namespace: ''
- description: Module to manage Virtual Machine and floating disks in oVirt/RHV
name: ovirt_disk
namespace: ''
- description: Retrieve information about one or more oVirt/RHV disks
name: ovirt_disk_info
namespace: ''
- description: Create or delete an event in oVirt/RHV
name: ovirt_event
namespace: ''
- description: This module can be used to retrieve information about one or more
oVirt/RHV events
name: ovirt_event_info
namespace: ''
- description: Module to manage external providers in oVirt/RHV
name: ovirt_external_provider
namespace: ''
- description: Retrieve information about one or more oVirt/RHV external providers
name: ovirt_external_provider_info
namespace: ''
- description: Module to manage groups in oVirt/RHV
name: ovirt_group
namespace: ''
- description: Retrieve information about one or more oVirt/RHV groups
name: ovirt_group_info
namespace: ''
- description: Module to manage hosts in oVirt/RHV
name: ovirt_host
namespace: ''
- description: Retrieve information about one or more oVirt/RHV hosts
name: ovirt_host_info
namespace: ''
- description: Module to manage host networks in oVirt/RHV
name: ovirt_host_network
namespace: ''
- description: Module to manage power management of hosts in oVirt/RHV
name: ovirt_host_pm
namespace: ''
- description: Retrieve information about one or more oVirt/RHV HostStorages (applicable
only for block storage)
name: ovirt_host_storage_info
namespace: ''
- description: Module to manage Instance Types in oVirt/RHV
name: ovirt_instance_type
namespace: ''
- description: Module to manage jobs in oVirt/RHV
name: ovirt_job
namespace: ''
- description: Module to manage MAC pools in oVirt/RHV
name: ovirt_mac_pool
namespace: ''
- description: Module to manage logical networks in oVirt/RHV
name: ovirt_network
namespace: ''
- description: Retrieve information about one or more oVirt/RHV networks
name: ovirt_network_info
namespace: ''
- description: Module to manage network interfaces of Virtual Machines in oVirt/RHV
name: ovirt_nic
namespace: ''
- description: Retrieve information about one or more oVirt/RHV virtual machine
network interfaces
name: ovirt_nic_info
namespace: ''
- description: Module to manage permissions of users/groups in oVirt/RHV
name: ovirt_permission
namespace: ''
- description: Retrieve information about one or more oVirt/RHV permissions
name: ovirt_permission_info
namespace: ''
- description: Module to manage datacenter quotas in oVirt/RHV
name: ovirt_quota
namespace: ''
- description: Retrieve information about one or more oVirt/RHV quotas
name: ovirt_quota_info
namespace: ''
- description: Module to manage roles in oVirt/RHV
name: ovirt_role
namespace: ''
- description: Retrieve information about one or more oVirt scheduling policies
name: ovirt_scheduling_policy_info
namespace: ''
- description: Module to manage Virtual Machine Snapshots in oVirt/RHV
name: ovirt_snapshot
namespace: ''
- description: Retrieve information about one or more oVirt/RHV virtual machine
snapshots
name: ovirt_snapshot_info
namespace: ''
- description: Module to manage storage connections in oVirt
name: ovirt_storage_connection
namespace: ''
- description: Module to manage storage domains in oVirt/RHV
name: ovirt_storage_domain
namespace: ''
- description: Retrieve information about one or more oVirt/RHV storage domains
name: ovirt_storage_domain_info
namespace: ''
- description: Retrieve information about one or more oVirt/RHV templates relate
to a storage domain.
name: ovirt_storage_template_info
namespace: ''
- description: Retrieve information about one or more oVirt/RHV virtual machines
relate to a storage domain.
name: ovirt_storage_vm_info
namespace: ''
- description: Module to manage tags in oVirt/RHV
name: ovirt_tag
namespace: ''
- description: Retrieve information about one or more oVirt/RHV tags
name: ovirt_tag_info
namespace: ''
- description: Module to manage virtual machine templates in oVirt/RHV
name: ovirt_template
namespace: ''
- description: Retrieve information about one or more oVirt/RHV templates
name: ovirt_template_info
namespace: ''
- description: Module to manage users in oVirt/RHV
name: ovirt_user
namespace: ''
- description: Retrieve information about one or more oVirt/RHV users
name: ovirt_user_info
namespace: ''
- description: Module to manage Virtual Machines in oVirt/RHV
name: ovirt_vm
namespace: ''
- description: Retrieve information about one or more oVirt/RHV virtual machines
name: ovirt_vm_info
namespace: ''
- description: Module to manage VM pools in oVirt/RHV
name: ovirt_vmpool
namespace: ''
- description: Retrieve information about one or more oVirt/RHV vmpools
name: ovirt_vmpool_info
namespace: ''
- description: Module to manage vNIC profile of network in oVirt/RHV
name: ovirt_vnic_profile
namespace: ''
- description: Retrieve information about one or more oVirt/RHV vnic profiles
name: ovirt_vnic_profile_info
namespace: ''
plugins:
inventory:
- description: oVirt inventory source
name: ovirt
namespace: null
release_date: '2020-04-09'
1.1.0:
changes:
bugfixes:
- ovirt_disk - Fix activate (https://github.com/oVirt/ovirt-ansible-collection/pull/61).
- ovirt_host_network - Fix custom_properties default value (https://github.com/oVirt/ovirt-ansible-collection/pull/65).
- ovirt_quota - Fix vcpu_limit (https://github.com/oVirt/ovirt-ansible-collection/pull/44).
- ovirt_vm - Fix cd_iso get all disks from storage domains (https://github.com/oVirt/ovirt-ansible-collection/pull/66).
- ovirt_vm - Fix cd_iso search by name (https://github.com/oVirt/ovirt-ansible-collection/pull/51).
major_changes:
- ovirt_disk - Add backup (https://github.com/oVirt/ovirt-ansible-collection/pull/57).
- ovirt_disk - Support direct upload/download (https://github.com/oVirt/ovirt-ansible-collection/pull/35).
- ovirt_host - Add ssh_port (https://github.com/oVirt/ovirt-ansible-collection/pull/60).
- ovirt_vm_os_info - Creation of module (https://github.com/oVirt/ovirt-ansible-collection/pull/26).
minor_changes:
- ovirt inventory - Add creation_time (https://github.com/oVirt/ovirt-ansible-collection/pull/34).
- ovirt inventory - Set inventory plugin insecure if no cafile defined (https://github.com/oVirt/ovirt-ansible-collection/pull/58).
- ovirt_disk - Add upload image warning for correct format (https://github.com/oVirt/ovirt-ansible-collection/pull/22).
- ovirt_disk - Force wait when uploading disk (https://github.com/oVirt/ovirt-ansible-collection/pull/43).
- ovirt_disk - Upload_image_path autodetect size (https://github.com/oVirt/ovirt-ansible-collection/pull/19).
- ovirt_network - Add support of removing vlan_tag (https://github.com/oVirt/ovirt-ansible-collection/pull/21).
- ovirt_vm - Add documentation for custom_script under sysprep (https://github.com/oVirt/ovirt-ansible-collection/pull/52).
- ovirt_vm - Hard code nic on_boot to true (https://github.com/oVirt/ovirt-ansible-collection/pull/45).
fragments:
- 19-ovirt_disk-upload_image_path-autodetect-size.yaml
- 21-ovirt_network-add-support-of-removing-vlan_tag.yaml
- 22-ovirt_disk-add-upload-image-warning-for-correct-format.yaml
- 26-add-ovirt_vm_os_info.yaml
- 34-ovirt-inventory-add-creation_time.yaml
- 35-ovirt_disk-support-direct-upload-download.yaml
- 43-ovirt_disk-force-wait-when-uploading-disk.yaml
- 44-ovirt_quota-fix-vcpu_limit-type.yaml
- 45-ovirt_vm-hard-code-nic-on_boot-to-true.yaml
- 51-ovirt_vm-fix-cd_iso-search-by-name.yaml
- 52-ovirt_vm-add-documentation-for-custom_script-under-sysprep.yaml
- 57-ovirt_disk-add-backup.yaml
- 58-ovirt-inventory-insecure-if-no-cafile-defined.yaml
- 60-ovirt_host-add-ssh_port.yaml
- 61-ovirt_disk-fix-activate.yaml
- 65-ovirt_host_network-fix-custom_properties-default-value.yaml
- 66-ovirt_vm-fix-cd_iso-get-all-disks-from-storage-domains.yaml
modules:
- description: Retrieve information on all supported oVirt/RHV operating systems
name: ovirt_vm_os_info
namespace: ''
release_date: '2020-08-12'
1.1.1:
changes:
minor_changes:
- ovirt_permission - Fix FQCN documentation (https://github.com/oVirt/ovirt-ansible-collection/pull/63).
release_date: '2020-08-12'
1.1.2:
release_date: '2020-08-17'
1.2.0:
changes:
bugfixes:
- 01_create_target_hosted_engine_vm - Force basic authentication (https://github.com/oVirt/ovirt-ansible-collection/pull/131).
- hosted_engine_setup - Allow uppercase characters in mac address (https://github.com/oVirt/ovirt-ansible-collection/pull/150).
- hosted_engine_setup - set custom bios type of hosted-engine VM to Q35+SeaBIOS
(https://github.com/oVirt/ovirt-ansible-collection/pull/129).
- hosted_engine_setup - use zcat instead of gzip (https://github.com/oVirt/ovirt-ansible-collection/pull/130).
- ovirt inventory - Add close of connection at the end (https://github.com/oVirt/ovirt-ansible-collection/pull/122).
- ovirt_disk - dont move disk when already in storage_domain (https://github.com/oVirt/ovirt-ansible-collection/pull/135)
- ovirt_disk - fix upload when direct upload fails (https://github.com/oVirt/ovirt-ansible-collection/pull/120).
- ovirt_vm - Fix template search (https://github.com/oVirt/ovirt-ansible-collection/pull/132).
- ovirt_vm - Rename q35_sea to q35_sea_bios (https://github.com/oVirt/ovirt-ansible-collection/pull/111).
major_changes:
- cluster_upgrade - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/94).
- disaster_recovery - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/134).
- engine_setup - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/69).
- hosted_engine_setup - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/106).
- image_template - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/95).
- infra - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/92).
- manageiq - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/97).
- repositories - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/96).
- shutdown_env - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/112).
- vm_infra - Migrate role (https://github.com/oVirt/ovirt-ansible-collection/pull/93).
minor_changes:
- Add GPL license (https://github.com/oVirt/ovirt-ansible-collection/pull/101).
- hosted_engine_setup - Add compatibility_version (https://github.com/oVirt/ovirt-ansible-collection/pull/125).
- ovirt_disk - ignore move of HE disks (https://github.com/oVirt/ovirt-ansible-collection/pull/162).
- ovirt_nic - Add template_version (https://github.com/oVirt/ovirt-ansible-collection/pull/145).
- ovirt_nic_info - Add template (https://github.com/oVirt/ovirt-ansible-collection/pull/146).
- ovirt_vm_info - Add current_cd (https://github.com/oVirt/ovirt-ansible-collection/pull/144).
fragments:
- add-cluster_upgrade-role.yml
- add-disaster_recovery-role.yml
- add-engine_setup-role.yml
- add-gpl-license.yml
- add-hosted_engine_setup-role.yml
- add-image_template-role.yml
- add-infra-role.yml
- add-manageiq-role.yml
- add-repositories-role.yml
- add-shutdown_env-role.yml
- add-vm_infra-role.yml
- basic_auth-fix_create_target_hosted_engine_vm.yml
- hosted_engine_setup-add-compatibility_version.yml
- hosted_engine_setup-allow-uppercase-in-mac-address.yml
- hosted_engine_setup-set-custom-bios-type.yml
- hosted_engine_setup-use-zcat-instead-of-gzip.yml
- ovirt-inventory-add-connection-close.yml
- ovirt_disk-fix-move.yml
- ovirt_disk-fix-upload-when-direct-upload-fails.yml
- ovirt_disk-ignore-he-disk-move.yml
- ovirt_nic-add-template_version.yml
- ovirt_nic_info-add-template.yml
- ovirt_vm-fix-template-search.yml
- ovirt_vm-rename-q35_sea.yml
- ovirt_vm_info-add-current_cd.yml
release_date: '2020-10-27'
1.2.1:
changes:
bugfixes:
- disaster_recovery - Fix multiple configuration issues like paths, "~" support,
user input messages, etc. (https://github.com/oVirt/ovirt-ansible-collection/pull/160).
fragments:
- disaster_recovery-fix-configuration-issues.yml
release_date: '2020-11-02'
1.2.2:
changes:
bugfixes:
- hosted_engine_setup - Clean VNC encryption config (https://github.com/oVirt/ovirt-ansible-collection/pull/175/).
- inventory plugin - Fix timestamp for Python 2 (https://github.com/oVirt/ovirt-ansible-collection/pull/173).
fragments:
- hosted_engine_setup-clean-vnc-encryption-config.yml
- inventory-plugin-fix-python2-timestamp-issue.yml
release_date: '2020-11-12'
1.2.3:
changes:
minor_changes:
- engine_setup - Add missing restore task file and vars file (https://github.com/oVirt/ovirt-ansible-collection/pull/180).
- hosted_engine_setup - Add after_add_host hook (https://github.com/oVirt/ovirt-ansible-collection/pull/181).
fragments:
- engine_setup-add-missing-restore-file.yml
- he_add-after_add_host-hook.yml
release_date: '2020-11-30'
1.2.4:
changes:
minor_changes:
- infra - don't require passowrd for user (https://github.com/oVirt/ovirt-ansible-collection/pull/195).
- inventory - correct os_type name (https://github.com/oVirt/ovirt-ansible-collection/pull/194).
- ovirt_disk - automatically detect virtual size of qcow image (https://github.com/oVirt/ovirt-ansible-collection/pull/183).
fragments:
- 183-ovirt_disk-fix-upload-detection.yml
- 194-inventory-correct-name-of-os_type.yml
- 195-infra-dont-require-password-for-user.yml
release_date: '2020-12-14'
1.3.0:
changes:
major_changes:
- ovirt_system_option_info - Add new module (https://github.com/oVirt/ovirt-ansible-collection/pull/206).
minor_changes:
- ansible-builder - Update bindep (https://github.com/oVirt/ovirt-ansible-collection/pull/197).
- hosted_engine_setup - Collect all engine /var/log (https://github.com/oVirt/ovirt-ansible-collection/pull/202).
- hosted_engine_setup - Use ovirt_system_option_info instead of REST API (https://github.com/oVirt/ovirt-ansible-collection/pull/209).
- ovirt_disk - Add install warning (https://github.com/oVirt/ovirt-ansible-collection/pull/208).
- ovirt_info - Fragment add auth suboptions to documentation (https://github.com/oVirt/ovirt-ansible-collection/pull/205).
fragments:
- 197-update-bindep.yml
- 202-hosted_engine_setup-collect-all-engine-log.yml
- 205-ovirt_info-fragment-add-auth-suboptions-docs.yml
- 206-add-ovirt_system_option_info.yml
- 208-ovirt_disk-add-install-warning.yml
- 209-hosted_engine_setup-use-ovirt_system_option_info.yml
release_date: '2021-01-28'
1.3.1:
changes:
minor_changes:
- hosted_engine_setup - Disable reboot_after_installation (https://github.com/oVirt/ovirt-ansible-collection/pull/218).
- ovirt_host - Add reboot_after_installation option (https://github.com/oVirt/ovirt-ansible-collection/pull/217).
fragments:
- hosted_engine_setup-disable-reboot-after-install.yml
- ovirt_host-add-reboot_after_installation.yml
release_date: '2021-02-10'
1.4.0:
changes:
bugfixes:
- Set ``auth`` options into argument spec definition so Ansible will validate
the user options
- Set ``no_log`` on ``password`` and ``token`` in the ``auth`` dict so the values
are exposed in the invocation log
minor_changes:
- cluster_upgrade - Add correlation-id header (https://github.com/oVirt/ovirt-ansible-collection/pull/222).
- engine_setup - Add skip renew pki confirm (https://github.com/oVirt/ovirt-ansible-collection/pull/228).
- examples - Add recipe for removing DM device (https://github.com/oVirt/ovirt-ansible-collection/pull/233).
- hosted_engine_setup - Filter devices with unsupported bond mode (https://github.com/oVirt/ovirt-ansible-collection/pull/226).
- infra - Add reboot host parameters (https://github.com/oVirt/ovirt-ansible-collection/pull/231).
- ovirt_disk - Add SATA support (https://github.com/oVirt/ovirt-ansible-collection/pull/225).
- ovirt_user - Add ssh_public_key (https://github.com/oVirt/ovirt-ansible-collection/pull/232)
fragments:
- 222-cluster_upgrade-add-correlation-id.yml
- 225-ovirt_disk-add-sata.yml
- 226-hosted_engine_setup-filter-devices.yml
- 228-add-skip-renew-pki.yml
- 231-infra-add-reboot-params.yml
- 232-ovirt_user-add-ssh_public_key.yml
- 233-examples-add-recipe-for-removing-DM-device.yml
- auth_dict.yml
release_date: '2021-03-16'
1.4.1:
changes:
bugfixes:
- hosted_engine_setup - Fix auth revoke (https://github.com/oVirt/ovirt-ansible-collection/pull/237).
fragments:
- 237-hosted_engine_setup-fix-auth_revoke.yml
release_date: '2021-03-22'
1.4.2:
changes:
minor_changes:
- hosted_engine_setup - Add an error message for FIPS on CentOS (https://github.com/oVirt/ovirt-ansible-collection/pull/250).
- hosted_engine_setup - Fix the appliance distribution (https://github.com/oVirt/ovirt-ansible-collection/pull/249).
- infra - remove target from ovirt_storage_connection (https://github.com/oVirt/ovirt-ansible-collection/pull/252).
- ovirt_vm - Allow migration between clusters (https://github.com/oVirt/ovirt-ansible-collection/pull/236).
- repositories - Add host ppc (https://github.com/oVirt/ovirt-ansible-collection/pull/248).
- repositories - Remove ansible channels from RHV 4.4 (https://github.com/oVirt/ovirt-ansible-collection/pull/242).
- repositories - fix ppc repos (https://github.com/oVirt/ovirt-ansible-collection/pull/254).
fragments:
- 236-ovirt_vm-allow-cluster-migration.yml
- 242-repositories-remove-ansible-channels-from-RHV-4.4.yml
- 248-repositories-add-host-ppc.yml
- 249-hosted_engine_setup-fix-the-appliance-distribution.yml
- 250-hosted_engine_setup-add-an-error-message-for-FIPS-on-centos.yml
- 252-infra-remove-target-from-ovirt_storage_connection.yml
- 254-repositories-fix-ppc-repos.yml
release_date: '2021-04-23'
1.5.0:
changes:
bugfixes:
- hosted_engine_setup - Use ovirt_host module to discover iscsi (https://github.com/oVirt/ovirt-ansible-collection/pull/275).
- hosted_engine_setup - align with ansible-lint 5.0.0 (https://github.com/oVirt/ovirt-ansible-collection/pull/271).
minor_changes:
- disaster_recovery - Change conf paths (https://github.com/oVirt/ovirt-ansible-collection/pull/286).
- hosted_engine_setup - Add-pause-option-before-engine-setup (https://github.com/oVirt/ovirt-ansible-collection/pull/273).
- hosted_engine_setup - Remove leftover code and omit parameters (https://github.com/oVirt/ovirt-ansible-collection/pull/281).
- infra - Storage fix parameters typo (https://github.com/oVirt/ovirt-ansible-collection/pull/282).
- ovirt_host - Update iscsi target struct (https://github.com/oVirt/ovirt-ansible-collection/pull/274).
fragments:
- 274-ovirt_host-update-iscsi-target-struct.yml
- 282-infra-storage-fix-parameters-typo.yml
- 286-dr-change-conf-paths.yml
- hosted_engine_setup-add-pause-option-before-engine-setup.yml
- hosted_engine_setup-ansible-lint-5.0.0-alignment.yml
- hosted_engine_setup-remove-leftovers-code.yml
- hosted_engine_setup-use-ovirt_host-module-to-discover-iscsi.yml
release_date: '2021-06-04'
1.5.1:
changes:
bugfixes:
- hosted_engine_setup - Filter VLAN devices with bad names (https://github.com/oVirt/ovirt-ansible-collection/pull/238)
- hosted_engine_setup - Remove cloud-init configuration (https://github.com/oVirt/ovirt-ansible-collection/pull/295).
- ovirt inventory plugin - allow several valid values for the `plugin` key (https://github.com/oVirt/ovirt-ansible-collection/pull/293).
minor_changes:
- hosted_engine_setup - use-ansible-host (https://github.com/oVirt/ovirt-ansible-collection/pull/277).
- infra role - Add external_provider parameter on networks role of infra role
(https://github.com/oVirt/ovirt-ansible-collection/pull/297)
- ovirt_vm - Add placement_policy_hosts (https://github.com/oVirt/ovirt-ansible-collection/pull/294).
fragments:
- 238-filter-vlan-devices-with-bad-names.yml
- 294-ovirt_vm-add-placement_policy_hosts.yml
- 297-ovirt_infra_networks-add-external-provider.yml
- hosted_engine_setup-add-host-use_IP.yml
- hosted_engine_setup-remove-cloud-init-config.yml
- inventory_plugin_key_choices.yml
release_date: '2021-06-17'
1.5.2:
changes:
minor_changes:
- hosted_engine_setup - Do not try to sync at end of full_execution (https://github.com/oVirt/ovirt-ansible-collection/pull/305)
- ovirt_vm - Add default return value to check_placement_policy (https://github.com/oVirt/ovirt-ansible-collection/pull/301).
fragments:
- 301-ovirt_vm-add-default-to-check_placement_policy.yml
- 305-HE-do-not-sync-at-full-execution-end.yml
release_date: '2021-06-23'
1.5.3:
changes:
minor_changes:
- Don't rely on safe_eval being able to do math/concat (https://github.com/oVirt/ovirt-ansible-collection/pull/307)
- hosted_engine_setup - Fix engine vm add_host for the target machine (https://github.com/oVirt/ovirt-ansible-collection/pull/311)
- hosted_engine_setup - Minor doc update (https://github.com/oVirt/ovirt-ansible-collection/pull/310)
fragments:
- 307-safe-eval-no-concat.yml
- 310-HE-minor-doc-update.yml
- 311-fix-add-host-target-vm.yml
release_date: '2021-06-25'
1.5.4:
changes:
bugfixes:
- hosted_engine_setup - Use forward network during an IPv6 deployment (https://github.com/oVirt/ovirt-ansible-collection/pull/315)
- hosted_engine_setup - remove duplicate tasks (https://github.com/oVirt/ovirt-ansible-collection/pull/314)
- ovirt_permission - fix group search that has space in it's name (https://github.com/oVirt/ovirt-ansible-collection/pull/318)
minor_changes:
- hosted_engine_setup - Allow FIPS on HE VM (https://github.com/oVirt/ovirt-ansible-collection/pull/313)
fragments:
- 313-allow-fips-on-HE-vm.yml
- 314-remove-duplicate-tasks.yml
- 315-use-forward-netrok-during-ipv6-deployment.yml
- 318-ovirt_permission-fix-group-search-that-has-space.yml
release_date: '2021-07-22'
1.5.5:
changes:
bugfixes:
- ovirt_auth - Fix password and username requirements (https://github.com/oVirt/ovirt-ansible-collection/pull/325).
- ovirt_disk - Fix update_check with no VM (https://github.com/oVirt/ovirt-ansible-collection/pull/323).
major_changes:
- remove_stale_lun - Add role for removing stale LUN (https://bugzilla.redhat.com/1966873).
minor_changes:
- engine_setup - Wait for webserver up after engine-config reboot (https://github.com/oVirt/ovirt-ansible-collection/pull/324).
- hosted_engine_setup - Pause deployment on failure of `engine-backup --mode=restore`
(https://github.com/oVirt/ovirt-ansible-collection/pull/327).
- hosted_engine_setup - Text change - Consistently use 'bootstrap engine VM'
(https://github.com/oVirt/ovirt-ansible-collection/pull/328).
- hosted_engine_setup - Update Ansible requirements in README (https://github.com/oVirt/ovirt-ansible-collection/pull/321)
- readme - Update Ansible requirement (https://github.com/oVirt/ovirt-ansible-collection/pull/326).
fragments:
- 321-hosted_engine_setup-update-ansible-requirements-in-readme.yml
- 323-ovirt_disk-fix-update_check-with-no-vm.yml
- 324-engine_setup-wait-for-engine-config-reboot.yml
- 325-ovirt_auth-fix-passowrd-and-username-req.yml
- 326-readme-update-ansible-requirements.yml
- 327-pause-on-restore.yml
- 328-bootstrap-texts.yml
- add-remove_stale_lun-role.yml
release_date: '2021-08-11'
1.6.1:
changes:
bugfixes:
- hosted_engine_setup - Use default bridge for IPv6 advertisements (https://github.com/oVirt/ovirt-ansible-collection/pull/331)
- ovirt_auth - Fix token no_log (https://github.com/oVirt/ovirt-ansible-collection/pull/332).
fragments:
- 331-use-default-bridge-for-ipv6-advertisements.yml
- 332-ovirt_auth-fix-token-no_log.yml
release_date: '2021-08-25'
1.6.2:
changes:
minor_changes:
- remove_stale_lun - Fix example for `remote_stale_lun` role to be able to run
it from engine (https://github.com/oVirt/ovirt-ansible-collection/pull/334).
fragments:
- 334-remove_stale_lun-role.yml
release_date: '2021-08-26'
2.0.0:
changes:
bugfixes:
- hosted_engine_setup - Add OpenSCAP security profile name parameter (https://github.com/oVirt/ovirt-ansible-collection/pull/411).
- hosted_engine_setup - Add an option to set the storage format when createing
a storage domain and use it (https://github.com/oVirt/ovirt-ansible-collection/pull/463).
- hosted_engine_setup - Adjust files permissions (https://github.com/oVirt/ovirt-ansible-collection/pull/409).
- hosted_engine_setup - Fix call to engine-psql for vds_spm_id (https://github.com/oVirt/ovirt-ansible-collection/pull/459).
- hosted_engine_setup - Fix cloud-init package removal in airgapped environment
(https://github.com/oVirt/ovirt-ansible-collection/pull/442)
- hosted_engine_setup - Remove SPICE graphic protocol (https://github.com/oVirt/ovirt-ansible-collection/pull/394).
- hosted_engine_setup - Replace xml community module (https://github.com/oVirt/ovirt-ansible-collection/pull/438).
- hosted_engine_setup - Support disa stig profile (https://github.com/oVirt/ovirt-ansible-collection/pull/426).
- hosted_engine_setup - Use cat command (https://github.com/oVirt/ovirt-ansible-collection/pull/443).
- hosted_engine_setup - Use tpgt in iscsi login (https://github.com/oVirt/ovirt-ansible-collection/pull/338)
- image_template - Remove static no - unsupported in ansible 2.12 (https://github.com/oVirt/ovirt-ansible-collection/pull/341).
- ovirt_host - Fix failed_state_after_reinstall condition (https://github.com/oVirt/ovirt-ansible-collection/pull/371).
- ovirt_template - Fix creating templates where the base template version number
is not 1 (https://github.com/oVirt/ovirt-ansible-collection/pull/370).
- repositories - Fix dnf module variable (https://github.com/oVirt/ovirt-ansible-collection/pull/454).
- repositories - fix force flag on subscription-manager (https://github.com/oVirt/ovirt-ansible-collection/pull/430).
major_changes:
- manageiq - role removed (https://github.com/oVirt/ovirt-ansible-collection/pull/375).
minor_changes:
- Add json_query filter (https://github.com/oVirt/ovirt-ansible-collection/pull/436).
- cluster_upgrade - Add progress tracking via event logs to the role (https://github.com/oVirt/ovirt-ansible-collection/pull/415)
- cluster_upgrade - Directly log progress to the cluster (https://github.com/oVirt/ovirt-ansible-collection/pull/449)
- engine_setup - Honor ovirt_engine_setup_offline variable (https://github.com/oVirt/ovirt-ansible-collection/pull/381).
- engine_setup - Prepare answer files and default values for 4.5 release (https://github.com/oVirt/ovirt-ansible-collection/pull/414).
- gluster_heal_info - Replacing gluster module to CLI to support RHV automation
hub (https://github.com/oVirt/ovirt-ansible-collection/pull/340).
- hosted_engine - Replace virt_net and xml with commands (https://github.com/oVirt/ovirt-ansible-collection/pull/359).
- hosted_engine_setup - Fix default gateway variable name (https://github.com/oVirt/ovirt-ansible-collection/pull/423).
- hosted_engine_setup - Fix default gateway variable name (https://github.com/oVirt/ovirt-ansible-collection/pull/423).
- hosted_engine_setup - Fix permissions on copied engine logs, needed for OpenSCAP
(https://github.com/oVirt/ovirt-ansible-collection/pull/404).
- hosted_engine_setup - Honor he_offline_deployment variable (https://github.com/oVirt/ovirt-ansible-collection/pull/380).
- hosted_engine_setup - Replace calls to psql as postgres with engine_psql.sh
(https://github.com/oVirt/ovirt-ansible-collection/pull/453).
- hosted_engine_setup - configured abrt initial files only when needed (https://github.com/oVirt/ovirt-ansible-collection/pull/397).
- info - Rename follows to follow parameter and add alias (https://github.com/oVirt/ovirt-ansible-collection/pull/367).
- info - bump deprecate version for fetch_nested and nested_attributes (https://github.com/oVirt/ovirt-ansible-collection/pull/378).
- info modules - Add follow link url to api model links_summary
- info modules - Enable follow parameter (https://github.com/oVirt/ovirt-ansible-collection/pull/355).
- manageiq - add deprecation info (https://github.com/oVirt/ovirt-ansible-collection/pull/384).
- ovirt_disk - Add warning for disk attachments (https://github.com/oVirt/ovirt-ansible-collection/pull/347).
- ovirt_disk - Use imageio client (https://github.com/oVirt/ovirt-ansible-collection/pull/358).
- ovirt_event - enable correlation_id on events (https://github.com/oVirt/ovirt-ansible-collection/pull/368).
- ovirt_host - Add enroll_certificate (https://github.com/oVirt/ovirt-ansible-collection/pull/439).
- ovirt_permission - add mac pool (https://github.com/oVirt/ovirt-ansible-collection/pull/353).
- ovirt_remove_stale_lun - Allow user to remove multiple LUNs (https://github.com/oVirt/ovirt-ansible-collection/pull/357).
- ovirt_remove_stale_lun - Retry "multipath -f" while removing the LUNs (https://github.com/oVirt/ovirt-ansible-collection/pull/382).
- ovirt_remove_stale_lun - Use add_host instead of delegate_to (https://github.com/oVirt/ovirt-ansible-collection/pull/390).
- ovirt_storage_template_info - fix docs (https://github.com/oVirt/ovirt-ansible-collection/pull/356).
- ovirt_storage_vm_info - fix docs (https://github.com/oVirt/ovirt-ansible-collection/pull/356).
- ovirt_template - Add ova import of template (https://github.com/oVirt/ovirt-ansible-collection/pull/304).
- ovirt_template - add boot_menu and bios_type https://github.com/oVirt/ovirt-ansible-collection/pull/465).
- ovirt_vm - Add display file_transfer_enabled and copy_paste_enabled (https://github.com/oVirt/ovirt-ansible-collection/pull/339).
- ovirt_vm - Add virtio_scsi_enabled and multi_queues_enabled (https://github.com/oVirt/ovirt-ansible-collection/pull/348).
- ovirt_vm - Add virtio_scsi_multi_queues (https://github.com/oVirt/ovirt-ansible-collection/pull/373).
- plugins - Remove unused imports (https://github.com/oVirt/ovirt-ansible-collection/pull/444).
- repositories - Add to the documentation variable priority (https://github.com/oVirt/ovirt-ansible-collection/pull/440).
- repositories - Replace redhat_subscription and rhsm_repository with command
(https://github.com/oVirt/ovirt-ansible-collection/pull/346).
- repositories - Update host and engine repositories to 4.4.9 (https://github.com/oVirt/ovirt-ansible-collection/pull/363).
- repositories - add no_log to register (https://github.com/oVirt/ovirt-ansible-collection/pull/350).
- repositories - add satelite support (https://github.com/oVirt/ovirt-ansible-collection/pull/431).
- vm_infra - Add no_log to Manage VMs state task (https://github.com/oVirt/ovirt-ansible-collection/pull/417).
fragments:
- 304-ovirt_template-add-ova-import.yml
- 338-use-tpgt-in-iscsi-login.yml
- 339-ovirt_vm-add-display-params.yml
- 340-replace-gluster-module-to-cli.yml
- 341-image_template-fix-include-tasks.yml
- 346-repositories-replace-redhat_subscription-and-rhsm_repository-with-command.yml
- 347-ovirt_disk-add-warning-for-disk-attachemtns.yml
- 348-ovirt_vm-add-virtio_scsi_enabled-and-multi_queues_enabled.yml
- 350-repositories-add-no_log-to-register.yml
- 351-ovirt_remove_stale_lun-allow-user-to-remove-multiple-luns.yml
- 352-ovirt_remove_stale_lun-Retry-Multipath-f-while-removing-the-luns.yml
- 353-ovirt_permission-add-mac-pool.yml
- 355-info-modules-enable-follow-parameter.yml
- 356-ovirt_storage_vm_info-and-ovirt_storage_template_info-fix-docs.yml
- 358-ovirt_disk-use-imageio-client.yml
- 359-he-replace-virt_net-and-xml-with-commands.yml
- 363-repositories-update-to-4.4.9.yml
- 367-info-rename-follows-to-follows.yml
- 368-ovirt_event-correlation_id.yml
- 370-ovirt_template-fix-template-version.yml
- 371-ovirt_host-fix-failed_state_after_reinstall-condition.yml
- 371-ovirt_vm-add-virtio_scsi_multi_queues.yml
- 375-manageiq-deprecate.yml
- 378-bump-deprecate-version.yml
- 380-hosted_engine_setup-honor-he_offline_deployment.yaml
- 381-engine_setup-honor-ovirt_engine_setup_offline.yaml
- 384-manageiq-add-deprecation-info.yaml
- 390-ovirt_remove_stale_lun-Use-add_host-instead-of-delegate_to.yml
- 394-hosted_engine_setup-remove-spice-graphic-protocol.yml
- 396-info-modules-add-follow-link-url.yml
- 397-he_engine_abrt_configuration.yaml
- 404_fix_permissions_openscap.yml
- 409-hosted_engine_setup-Adjust-files-permissions.yml
- 411-hosted_engine_setup-Add-security-profile-name-parameter.yml
- 414-prepare-for-4.5-release.yaml
- 415-cluster_upgrade-progress.yml
- 417-add-no_log-to-manage-vms-state-task.yml
- 423-hosted_engine_setup-fix-default-gateway-variable-name.yml
- 425-cluster_upgrade-shutdown-vms-only-on-pinned-hosts.yml
- 426-ovirt_hosted-engine_setup-support-disa-stig-profile.yml
- 430-repositories-fix-force-flag-on-subscription-manager.yml
- 431-repositories-add-satellite-support.yml
- 436-add-json_query-filter.yml
- 438-hosted_engine_setup-replace-xml-module.yml
- 439-ovirt_host-add-enroll_certificate.yml
- 440-repositories-update-docs.yml
- 442-cloud-init_fix_removal_in_airgapped_environment.yml
- 443-ovirt_hosted_engine_setup-use-cat-command.yml
- 444-plugins-remove_unused_imports.yml
- 449-cluster_upgrade-progress-log.yml
- 453-replace-calls-to-psql-as-postgres-with-engine_psql.yml
- 454-repositories-fix-dnf-module-variable.yml
- 459-hosted_engine_setup-fix-call-to-engine-psql-for-vds_spm_id.yml
- 465-ovirt_template-add-boot_menu-and-bios_type.yml
plugins:
callback:
- description: Output the log of ansible
name: stdout
namespace: null
release_date: '2022-04-03'
2.0.1:
changes:
bugfixes:
- Make storage_format optional - do not fail if missing (https://github.com/oVirt/ovirt-ansible-collection/pull/471).
fragments:
- 471-make-storage-format-optional.yml
release_date: '2022-04-05'
2.0.2:
changes:
bugfixes:
- Fix progress logging via REST (https://github.com/oVirt/ovirt-ansible-collection/pull/474).
fragments:
- 471-make-storage-format-optional.yml
- 474-cluster-update-log-progress-fix.yml
release_date: '2022-04-06'
2.0.3:
changes:
bugfixes:
- invenory - Fix url address (https://github.com/oVirt/ovirt-ansible-collection/pull/482).
- ovirt_vm - Fix creating a RAW VM from a COW template (https://github.com/oVirt/ovirt-ansible-collection/pull/466).
minor_changes:
- ovirt_affinity_group - Add affinity labels (https://github.com/oVirt/ovirt-ansible-collection/pull/481).
fragments:
- 466-ovirt_vm-fix-creating-raw-vm-from-cow-template.yml
- 481-ovirt_affinity_group-add-affinity-labels.yml
- 482-inventory-fix-url-address.yml
release_date: '2022-04-13'
2.0.4:
changes:
bugfixes:
- Fix the admin user name when using keycloak (https://github.com/oVirt/ovirt-ansible-collection/pull/488).
- Use cryptography < 37.0.0, as 37.0.0 emits a warning that fails testing. (https://github.com/oVirt/ovirt-ansible-collection/pull/492).
- Use rstcheck < 3.5.0, as 3.5.0 emits a warning that fails testing. (https://github.com/oVirt/ovirt-ansible-collection/pull/490).
- cluster_upgrade - fix wait_condition (https://github.com/oVirt/ovirt-ansible-collection/pull/510).
- hosted_engine_setup - Allocate 128MiB instead of 1GiB for he_metadata (https://github.com/oVirt/ovirt-ansible-collection/pull/489).
- hosted_engine_setup - Collect logs also on failures in 03_hosted_engine_final_tasks.yml
(https://github.com/oVirt/ovirt-ansible-collection/pull/504).
- hosted_engine_setup - Fix keycloak activation/checking (https://github.com/oVirt/ovirt-ansible-collection/pull/509).
- hosted_engine_setup - Require 'detail' to be 'Up' (https://github.com/oVirt/ovirt-ansible-collection/pull/498).
- hosted_engine_setup - fix archive ownership (https://github.com/oVirt/ovirt-ansible-collection/pull/501).
- infra - add warning for multiple storage connections (https://github.com/oVirt/ovirt-ansible-collection/pull/500).
fragments:
- 488-configure-keycloak.yml
- 489-ovirt_hosted_engine_setup-use-10mib-intead-of-1gib-for-metadata.yml
- 490-use-rstcheck-3.4.yml
- 492-use-cryptography-older-than-37.yml
- 498-require-detail-up.yml
- 500-role-infra-add-warning-for-multiple-storage-connections.yml
- 501-fix-archive-ownership.yml
- 504-collect-final-logs.yml
- 509-fix-keycloak-activation.yml
- 510-cluster-upgrade-fix-wait_condition.yml
release_date: '2022-06-03'
2.1.0:
changes:
bugfixes:
- hosted_engine_setup - Fix "'ansible' ModuleNotFoundError" in Disaster Recovery
scripts (https://github.com/oVirt/ovirt-ansible-collection/pull/503).
- hosted_engine_setup - Use command instead of firewalld module (https://github.com/oVirt/ovirt-ansible-collection/pull/508).
- ovirt_vm - Fix parsing None arguments (https://github.com/oVirt/ovirt-ansible-collection/pull/486).
- ovirt_vm - check if the snapshot exists (https://github.com/oVirt/ovirt-ansible-collection/pull/525).
minor_changes:
- Add convert_to_bytes filter (https://github.com/oVirt/ovirt-ansible-collection/pull/515).
- automation - Use python38 on el8 with ansible-core 2.12 and python39 on el9
with ansible-core 2.13 (https://github.com/oVirt/ovirt-ansible-collection/pull/518).
- cloud.py - Sync with orgin (https://github.com/oVirt/ovirt-ansible-collection/pull/519).
- engine_setup - Allow to disable cert validation (https://github.com/oVirt/ovirt-ansible-collection/pull/517).
- hosted_engine_setup - make vdsm config cleanup optional (https://github.com/oVirt/ovirt-ansible-collection/pull/521).
- ovirt - Remove deprecated distutils (https://github.com/oVirt/ovirt-ansible-collection/pull/516).
- ovirt_vm - add wait_after_lease (https://github.com/oVirt/ovirt-ansible-collection/pull/524).
fragments:
- 483-ovirt_vm-fix-None-args.yml
- 503-fix-ansible-ModuleNotFoundError.yml
- 508-ovirt_hosted_engine_setup-use-firewalld-command.yml
- 515-add-convert_to_bytes-filter.yml
- 516-remove-distutils-usage.yml
- 517-engien_setup-allow-to-disable-cert-validation.yml
- 518-ci-changes.yml
- 519-sync-cloud_py.yml
- 521-optional-cleanup.yml
- 524-ovirt_vm-add-wait_after_lease.yml
- 525-ovirt_vm-check-if-snap-exists.yml
release_date: '2022-06-09'
2.2.0:
changes:
bugfixes:
- HE - Handle migration to hosts that use systemd-coredump (https://github.com/oVirt/ovirt-ansible-collection/pull/557).
- cluster_upgrade - Fix starting up pinned vms (https://github.com/oVirt/ovirt-ansible-collection/pull/532).
- he - Align role with ansible-lint-6.0 (https://github.com/oVirt/ovirt-ansible-collection/pull/545).
- hosted_engine - Specify fqcn for ovirt_system_option_info (https://github.com/oVirt/ovirt-ansible-collection/pull/536).
- hosted_engine_setup - Fix cleanup on el9 (https://github.com/oVirt/ovirt-ansible-collection/pull/533).
- image_template - Remove static (https://github.com/oVirt/ovirt-ansible-collection/pull/537).
- image_template - Remove static no - unsupported in ansible 2.12 (https://github.com/oVirt/ovirt-ansible-collection/pull/341).
- ovirt_host - Fix host wait (https://github.com/oVirt/ovirt-ansible-collection/pull/531).
- ovirt_host - Fix restarted wait condition (https://github.com/oVirt/ovirt-ansible-collection/pull/551).
- ovirt_storage_domain - Fix inaccessible exception (https://github.com/oVirt/ovirt-ansible-collection/pull/534).
- ovirt_vm - check if user inputed graphical protocol (https://github.com/oVirt/ovirt-ansible-collection/pull/542).
- repositories - Move fips check to satellite CA install block (https://github.com/oVirt/ovirt-ansible-collection/pull/553).
- shutdown_env - Align role with ansible-lint-6.0 (https://github.com/oVirt/ovirt-ansible-collection/pull/544).
minor_changes:
- During he_setup, configure ovn with he_host_name for correct operation of
ovn (https://github.com/oVirt/ovirt-ansible-collection/pull/563).
- Fix "ansible-lint" version 6.0.0 "yaml" violations for "disaster_recovery"
role (https://github.com/oVirt/ovirt-ansible-collection/pull/543).
- Fix "ansible-lint" version 6.0.0 violations for "disaster_recovery" & "remove_stale_lun"
roles (https://github.com/oVirt/ovirt-ansible-collection/pull/554).
- Fix ansible-lint for basic roles (https://github.com/oVirt/ovirt-ansible-collection/pull/280).
- Updating the documentation - "vm_name" / "vm_id" and/or disk "id" parameter(s)
are required when extending disk with non-unique name (https://github.com/oVirt/ovirt-ansible-collection/pull/559).
- gluster_heal_info - Replacing gluster module to CLI to support RHV automation
hub (https://github.com/oVirt/ovirt-ansible-collection/pull/340).
- ovirt_disk - Add warning for disk attachments (https://github.com/oVirt/ovirt-ansible-collection/pull/347).
- ovirt_disk - Fix disk attachment to VM (https://github.com/oVirt/ovirt-ansible-collection/pull/361).
- ovirt_qos, ovirt_disk_profile, ovirt_disk - Add modules to allow for creation
and updating of disk_profiles (https://github.com/oVirt/ovirt-ansible-collection/pull/422).
- ovirt_snapshot - Add vm_id to select VM (https://github.com/oVirt/ovirt-ansible-collection/pull/550).
- ovirt_vm - Add reset of VM (https://github.com/oVirt/ovirt-ansible-collection/pull/538).
- ovirt_vm - Add virtio_scsi_enabled and multi_queues_enabled (https://github.com/oVirt/ovirt-ansible-collection/pull/348).
- ovirt_vm - add volatile (https://github.com/oVirt/ovirt-ansible-collection/pull/539).
- repositories - Add ovirt_repositories_rhsm_environment and FIPS fix (https://github.com/oVirt/ovirt-ansible-collection/pull/483).
- repositories - Replace redhat_subscription and rhsm_repository with command
(https://github.com/oVirt/ovirt-ansible-collection/pull/346).
fragments:
- 280-fix-ansible-lint-for-basic-roles.yml
- 340-replace-gluster-module-to-cli.yml
- 341-image_template-fix-include-tasks.yml
- 346-repositories-replace-redhat_subscription-and-rhsm_repository-with-command.yml
- 347-ovirt_disk-add-warning-for-disk-attachemtns.yml
- 348-ovirt_vm-add-virtio_scsi_enabled-and-multi_queues_enabled.yml
- 361-ovirt_disk-fix-disk-attachment.yml
- 422-add-qos-and-disk_profle.yml
- 483-repositories-add-rhsm_environment.yml
- 531-ovirt_host-fix-host-wait.yml
- 532-cluster_upgrade-fix-starting-up-pinned-vms.yml
- 533_fix_cleanup.yml
- 534-ovirt_storage_domain-fix-inaccessible-error.yml
- 536-he-specify-fqcn.yml
- 537-image_template-remove-static.yml
- 538-ovirt_vm-add-reset.yml
- 539-ovirt_vm-add-volatile.yml
- 542-ovirt_vm-check-graphical-protocol.yml
- 543-fix-ansible-lint-for_disaster_recovery.yml
- 544-shutdown_env-align-with-ansible-lint-6.0.yml
- 545-he-setup-align-with-ansible-lint-6.0.yml
- 550-ovirt_snapshot-add-vm_id.yml
- 551-ovirt_host-fix-restarted-wait-condition.yml
- 553-repositories-move-check-fips.yml
- 554-fix-ansible_lint-for-disaster_recovery-and-remove_stale_lun.yml
- 557-fix-he-migration-to-systemd-coredump-hosts.yml
- 559-update-documentation-ovirt_disk-requires-extra_params-when-extending-disk-with-non-unique-name.yml
- 563-he-setup-configure-ovn-with-he-host-fqdn.yml
release_date: '2022-07-25'
2.2.1:
changes:
bugfixes:
- hosted_engine_setup - fix hosted-engine.conf permissions and ownership (https://github.com/oVirt/ovirt-ansible-collection/pull/569).
minor_changes:
- During he_setup, configure ovn with he_host_address (https://github.com/oVirt/ovirt-ansible-collection/pull/568).
fragments:
- 568-he-setup-configure-ovn-with-he-host-fqdn.yml
- 569-heconf-permissions.yml
release_date: '2022-08-03'
2.2.2:
changes:
bugfixes:
- hosted_engine_setup - Detect hosted-engine-ha version using /usr/libexec/platform-python
(https://github.com/oVirt/ovirt-ansible-collection/pull/573).
- hosted_engine_setup - update ansible version in README (https://github.com/oVirt/ovirt-ansible-collection/pull/571).
- repositories - Add mod_auth_openidc:2.3 and nodejs:14 to dnf modules (https://github.com/oVirt/ovirt-ansible-collection/pull/578).
fragments:
- 571-hosted_engine_setup-update-ansible-version-in-readme.yml
- 573-hosted_engine_setup-fetch-hosted-engine-ha-version-by-rpm-command.yml
- 578-repositories-Add-mod_auth_openidc-and-nodejs-to-dnf-modules.yml
release_date: '2022-08-09'
2.2.3:
changes:
bugfixes:
- cluster_upgrade - skip host upgrades without anything to update (https://github.com/oVirt/ovirt-ansible-collection/pull/580).
- hosted_engine_setup - restore - remove host also based on name (https://github.com/oVirt/ovirt-ansible-collection/pull/567).
- repositories - Fix example variable names (https://github.com/oVirt/ovirt-ansible-collection/pull/582).
minor_changes:
- hosted_engine_setup - fix ovirt-provider-ovn-driver broken link (https://github.com/oVirt/ovirt-ansible-collection/pull/581).
fragments:
- 567-hosted_engine_setup-remove-host-based-on-name.yml
- 580-cluster_upgrade-skip-host-upgrades-without-anything-to-update.yml
- 581-hosted_engine_setup-fix-broken-link.yml
- 582-repositories-fix-example-variable-names.yml
release_date: '2022-08-15'
2.3.0:
changes:
bugfixes:
- Fix ovirtvmipsv4 when using attribute (https://github.com/oVirt/ovirt-ansible-collection/pull/596).
- he-setup - fix static ipv6 ifcfg setup (https://github.com/oVirt/ovirt-ansible-collection/pull/592).
- ovirt_host - Honor activate and reboot_after_installation when they are set
to false with reinstalled host state (https://github.com/oVirt/ovirt-ansible-collection/pull/587).
- repositories - RHV 4.4 SP1 is supported only on RHEL 8.6 EUS (https://github.com/oVirt/ovirt-ansible-collection/pull/576).
minor_changes:
- filters - Add documentation to all filters (https://github.com/oVirt/ovirt-ansible-collection/pull/603).
- ovirt_disk - Add read_only param for disk attachments (https://github.com/oVirt/ovirt-ansible-collection/pull/597).
- ovirt_disk - Fix disk attachment to VM (https://github.com/oVirt/ovirt-ansible-collection/pull/361).
fragments:
- 361-ovirt_disk-fix-disk-attachment.yml
- 576-repositories-rhv-4.4-sp1-is-supported-only-on-rhel-8.6-eus.yml
- 587-ovirt_host-honor-activate-and-reboot-params.yml
- 592-he-setup-static-ipv6.yml
- 596-fix-ovirtvmipsv4-when-using-attr.yml
- 597-ovirt_disk-add-read_only-param.yml
- 603-add-filter-docs.yml
release_date: '2022-10-13'
2.3.1:
changes:
bugfixes:
- filters - Fix ovirtvmipsv4 with attribute and network (https://github.com/oVirt/ovirt-ansible-collection/pull/607).
- filters - Fix ovirtvmipsv4 with filter to list (https://github.com/oVirt/ovirt-ansible-collection/pull/609).
- ovirt_host - Fix kernel_params elemets type (https://github.com/oVirt/ovirt-ansible-collection/pull/608).
fragments:
- 607-filters-fix-ovirtvmipsv4-with-atribute-and-network.yml
- 608-fix-ovirt_host-kernel_params-type.yml
- 609-filterip4-fix-filter-list.yml
release_date: '2022-10-27'
2.4.0:
changes:
bugfixes:
- cluster_upgrade - Add default random uuid to engine_correlation_id (https://github.com/oVirt/ovirt-ansible-collection/pull/624).
- image_template - Add template_bios_type (https://github.com/oVirt/ovirt-ansible-collection/pull/620).
fragments:
- 625-cluster_upgrade-add-default-random-uuid-to-engine_correlation_id.yml
- 626-image_template-add-template_bios_type.yml
release_date: '2022-11-15'
2.4.1:
changes:
bugfixes:
- cluster_upgrade - Fix the engine_correlation_id location (https://github.com/oVirt/ovirt-ansible-collection/pull/637).
fragments:
- 637-cluster_upgrade-fix-the-engine_correlation_id-location.yml
release_date: '2022-11-28'

View File

@@ -0,0 +1,31 @@
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: ovirt.ovirt
trivial_section_name: trivial
use_fqcn: true

View File

@@ -0,0 +1 @@
This file is a placeholder so when the maintainer is doing build the folder fragments are not deleted.

View File

@@ -0,0 +1,33 @@
- hosts: localhost
connection: local
vars_files:
# Contains encrypted `engine_password` varibale using ansible-vault
- passwords.yml
vars:
myvm: centos7
tasks:
- name: Login
ovirt_auth:
url: "https://ovirt-engine.example.com/ovirt-engine/api"
password: "{{ engine_password | default(omit) }}"
username: "admin@internal"
- name: Get VM myvm
ovirt_vm_info:
auth: "{{ ovirt_auth }}"
pattern: 'name={{ myvm }}'
next_run: false
register: vm
- name: Get next_run of VM myvm
ovirt_vm_info:
auth: "{{ ovirt_auth }}"
pattern: 'name={{ myvm }}'
next_run: true
register: vm_next_run
- name: Print what will be changed in next run of the VM
debug:
msg: "{{ vm.ovirt_vms[0] | ovirt.ovirt.ovirtdiff(vm_next_run.ovirt_vms[0]) }}"
collections:
- ovirt.ovirt

View File

@@ -0,0 +1,77 @@
- hosts: localhost
connection: local
vars:
myvm: centos8*
tasks:
- name: Get VMs
ovirt_vm_info:
auth:
url: "https://ovirt-engine.example.com/ovirt-engine/api"
username: "admin@internal"
password: "123456"
insecure: true
pattern: 'name={{ myvm }}'
fetch_nested: true
nested_attributes: ips
register: vms
- name: Print VM IP
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmip }}"
- name: Print VM all IPs
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmips }}"
- name: Print VM IPv4
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipv4 }}"
- name: Print VM all IPv4
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipsv4 }}"
- name: Print VM all IPv4 from specific network
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipsv4(network_ip='192.168.2.0/24') }}"
- name: Print VM IPv6
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipv6 }}"
- name: Print VM all IPv6
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipsv6 }}"
# *********************************************************
# *********************************************************
- name: ----
debug:
msg: "-------------------------------------"
# *********************************************************
# Print VM IPs as dictionaries with name as key
# *********************************************************
- name: Print VM IP
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmip(attr='name') }}"
- name: Print VM all IPs
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmips(attr='name') }}"
- name: Print VM IPv4
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipv4(attr='name') }}"
- name: Print VM all IPv4
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipsv4(attr='name') }}"
- name: Print VM IPv6
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipv6(attr='name') }}"
- name: Print VM all IPv6
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipsv6(attr='name') }}"
collections:
- ovirt.ovirt

View File

@@ -0,0 +1,21 @@
---
- name: oVirt ansible collection
hosts: localhost
connection: local
vars_files:
# Contains encrypted `engine_password` varibale using ansible-vault
- passwords.yml
tasks:
- name: Login
ovirt_auth:
url: "https://ovirt-engine.example.com/ovirt-engine/api"
password: "{{ engine_password | default(omit) }}"
username: "admin@internal"
- name: Create vm
ovirt_vm:
auth: "{{ ovirt_auth }}"
name: vm_name
state: present
cluster: Default
collections:
- ovirt.ovirt

View File

@@ -0,0 +1,191 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2014 Red Hat, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -0,0 +1,17 @@
---
version: 1
dependencies:
system: bindep.txt
galaxy: requirements.yml
python: requirements.txt
additional_build_steps:
prepend:
- RUN pip3 install --upgrade pip setuptools
# Workaround for https://bugzilla.redhat.com/2024629
# - RUN dnf copr enable -y ovirt/ovirt-master-snapshot
- RUN rpm --import https://download.copr.fedorainfracloud.org/results/ovirt/ovirt-master-snapshot/pubkey.gpg
- RUN dnf --repofrompath=ovirt-master-snapshot,https://download.copr.fedorainfracloud.org/results/ovirt/ovirt-master-snapshot/centos-stream-8-x86_64/ install -y ovirt-release-master
- RUN yum install ovirt-ansible-collection -y
append:
- RUN ls -la /usr/share/ansible/collections/ansible_collections/

View File

@@ -0,0 +1,7 @@
---
collections:
- name: ansible.netcommon
version: <3.0.0
- name: ansible.posix
- name: ansible.utils
version: <2.6.0

View File

@@ -0,0 +1,82 @@
---
requires_ansible: '>=2.9.10'
action_groups:
ovirt:
- ovirt_affinity_group
- ovirt_affinity_label_facts
- ovirt_affinity_label_info
- ovirt_affinity_label
- ovirt_api_facts
- ovirt_api_info
- ovirt_auth
- ovirt_cluster_facts
- ovirt_cluster_info
- ovirt_cluster
- ovirt_datacenter_facts
- ovirt_datacenter_info
- ovirt_datacenter
- ovirt_disk_facts
- ovirt_disk_info
- ovirt_disk
- ovirt_event_facts
- ovirt_event_info
- ovirt_event
- ovirt_external_provider_facts
- ovirt_external_provider_info
- ovirt_external_provider
- ovirt_group_facts
- ovirt_group_info
- ovirt_group
- ovirt_host_facts
- ovirt_host_info
- ovirt_host_network
- ovirt_host_pm
- ovirt_host
- ovirt_host_storage_facts
- ovirt_host_storage_info
- ovirt_instance_type
- ovirt_job
- ovirt_mac_pool
- ovirt_network_facts
- ovirt_network_info
- ovirt_network
- ovirt_nic_facts
- ovirt_nic_info
- ovirt_nic
- ovirt_permission_facts
- ovirt_permission_info
- ovirt_permission
- ovirt_quota_facts
- ovirt_quota_info
- ovirt_quota
- ovirt_role
- ovirt_scheduling_policy_facts
- ovirt_scheduling_policy_info
- ovirt_snapshot_facts
- ovirt_snapshot_info
- ovirt_snapshot
- ovirt_storage_connection
- ovirt_storage_domain_facts
- ovirt_storage_domain_info
- ovirt_storage_domain
- ovirt_storage_template_facts
- ovirt_storage_template_info
- ovirt_storage_vm_facts
- ovirt_storage_vm_info
- ovirt_tag_facts
- ovirt_tag_info
- ovirt_tag
- ovirt_template_facts
- ovirt_template_info
- ovirt_template
- ovirt_user_facts
- ovirt_user_info
- ovirt_user
- ovirt_vm_facts
- ovirt_vm_info
- ovirt_vmpool_facts
- ovirt_vmpool_info
- ovirt_vmpool
- ovirt_vm
- ovirt_vnic_profile_info
- ovirt_vnic_profile

View File

@@ -0,0 +1,409 @@
%global namespace ovirt
%global collectionname ovirt
%global ansible_collections_dir ansible/collections/ansible_collections
Name: ovirt-ansible-collection
Summary: Ansible collection to manage all ovirt modules and inventory
Version: 2.4.1
Release: 1%{?release_suffix}%{?dist}
Source0: http://resources.ovirt.org/pub/src/ovirt-ansible-collection/ovirt-ansible-collection-2.4.1.tar.gz
License: ASL 2.0 and GPLv3+
BuildArch: noarch
Url: http://www.ovirt.org
BuildRequires: ansible-core
BuildRequires: ansible-test
%if 0%{?rhel} > 7 && 0%{?rhel} < 9
BuildRequires: glibc-langpack-en
%endif
Requires: ansible-core >= 2.12.0
Requires: ovirt-imageio-client
Requires: python3-ovirt-engine-sdk4 >= 4.5.0
Requires: python3-netaddr
Requires: python3-jmespath
Requires: python3-passlib
Requires: ansible-collection-ansible-netcommon
Requires: ansible-collection-ansible-posix
Requires: ansible-collection-ansible-utils
Requires: qemu-img
%if 0%{?rhel} < 9
Requires: python38-ovirt-imageio-client
Requires: python38-ovirt-engine-sdk4 >= 4.5.0
Requires: python38-netaddr
Requires: python38-jmespath
Requires: python38-passlib
%endif
Obsoletes: ansible < 2.10.0
Obsoletes: ovirt-ansible-cluster-upgrade
Obsoletes: ovirt-ansible-disaster-recovery
Obsoletes: ovirt-ansible-engine-setup
Obsoletes: ovirt-ansible-hosted-engine-setup
Obsoletes: ovirt-ansible-image-template
Obsoletes: ovirt-ansible-infra
Obsoletes: ovirt-ansible-manageiq
Obsoletes: ovirt-ansible-repositories
Obsoletes: ovirt-ansible-roles
Obsoletes: ovirt-ansible-shutdown-env
Obsoletes: ovirt-ansible-vm-infra
Provides: ovirt-ansible-cluster-upgrade
Provides: ovirt-ansible-disaster-recovery
Provides: ovirt-ansible-engine-setup
Provides: ovirt-ansible-hosted-engine-setup
Provides: ovirt-ansible-image-template
Provides: ovirt-ansible-infra
Provides: ovirt-ansible-manageiq
Provides: ovirt-ansible-repositories
Provides: ovirt-ansible-roles
Provides: ovirt-ansible-shutdown-env
Provides: ovirt-ansible-vm-infra
%description
This Ansible collection is to manage all ovirt modules and inventory
%prep
%setup -c -q
%build
%install
export PKG_DATA_DIR_ORIG=%{_datadir}/%{ansible_collections_dir}
export PKG_DATA_DIR=%{buildroot}$PKG_DATA_DIR_ORIG
export PKG_DOC_DIR=%{buildroot}%{_pkgdocdir}
sh build.sh install %{collectionname}
%files
%{_datadir}/%{ansible_collections_dir}/%{namespace}
%if "%{collectionname}" == "rhv"
%{_datadir}/%{ansible_collections_dir}/ovirt
%endif
%doc README.md
%doc examples/
%license licenses
%changelog
* Tue Nov 15 2022 Martin Necas <mnecas@redhat.com> - 2.4.0-1
- cluster_upgrade - Add default random uuid to engine_correlation_id
- image_template - Add template_bios_type
* Thu Oct 27 2022 Martin Necas <mnecas@redhat.com> - 2.3.1-1
- filters - Fix ovirtvmipsv4 with attribute and network
- filters - Fix ovirtvmipsv4 with filter to list
- ovirt_host - Fix kernel_params elemets type
* Thu Oct 13 2022 Martin Necas <mnecas@redhat.com> - 2.3.0-1
- ovirt_host - Honor activate and reboot_after_installation when they are set to false with reinstalled host state
- ovirt_disk - Add read_only param for disk attachments
- ovirt_disk - Fix disk attachment to VM
- filters - Add documentation to all filters
- filters- Fix ovirtvmipsv4 when using attribute
- he-setup - Fix static ipv6 ifcfg setup
- repositories - RHV 4.4 SP1 is supported only on RHEL 8.6 EUS
* Mon Aug 15 2022 Martin Necas <mnecas@redhat.com> - 2.2.3-1
- cluster_upgrade - Skip host upgrades without anything to update
- hosted_engine_setup - Fix ovirt-provider-ovn-driver broken link
- hosted_engine_setup - restore - Remove host also based on name
- repositories - Fix example variable names
* Tue Aug 9 2022 Martin Necas <mnecas@redhat.com> - 2.2.2-1
- hosted_engine_setup - Detect hosted-engine-ha version using /usr/libexec/platform-python
- hosted_engine_setup - update ansible version in README
- repositories - Add mod_auth_openidc:2.3 and nodejs:14 to dnf modules
* Wed Aug 3 2022 Martin Necas <mnecas@redhat.com> - 2.2.1-1
- hosted_engine_setup - Fix hosted-engine.conf permissions and ownership
- hosted_engine_setup - During he_setup, configure ovn with he_host_address
* Mon Jul 25 2022 Martin Necas <mnecas@redhat.com> - 2.2.0-1
- cluster_upgrade - Fix starting up pinned vms
- disaster_recovery - Fix ansible-lint version 6.0.0 violations
- fix ansible-lint for basic roles(infra, vm_infra, engine_setup, repositories, cluster_upgrade)
- gluster_heal_info - Replacing gluster module to CLI to support RHV automation hub
- image_template - Remove static no - unsupported in ansible 2.12
- hosted_engine - During he_setup, configure ovn with he_host_name for correct operation of ovn
- hosted_engine - Handle migration to hosts that use systemd-coredump
- hosted_engine - Specify fqcn for ovirt_system_option_info
- hosted_engine - Align role with ansible-lint-6.0
- hosted_engine - Fix cleanup on el9
- ovirt_disk - Add warning for disk attachments
- ovirt_disk - Fix disk attachment to VM
- ovirt_disk - Updating the documentation - vm_name/vm_id and/or disk id parameter(s) are required when extending disk with non-unique name
- ovirt_host - Fix host wait
- ovirt_host - Fix restarted wait condition
- ovirt_qos, ovirt_disk_profile, ovirt_disk - Add modules to allow for creation and updating of disk_profiles
- ovirt_snapshot - Add vm_id to select VM
- ovirt_storage_domain - Fix inaccessible exception
- ovirt_vm - Add reset of VM
- ovirt_vm - Add virtio_scsi_enabled and multi_queues_enabled
- ovirt_vm - Add volatile
- ovirt_vm - Check if user inputed graphical protocol
- remove_stale_lun - Fix ansible-lint version 6.0.0 violations
- repositories - Add ovirt_repositories_rhsm_environment and FIPS fix
- repositories - Replace redhat_subscription and rhsm_repository with command
- repositories - Move fips check to satellite CA install block
- shutdown_env - Align role with ansible-lint-6.0.0
* Thu Jun 9 2022 Martin Necas <mnecas@redhat.com> - 2.1.0-1
- Add convert_to_bytes filter
- automation - Use python38 on el8 with ansible-core 2.12 and python39 on el9 with ansible-core 2.13
- engine_setup - Allow to disable cert validation
- ovirt - Remove deprecated distutils
- ovirt_vm - add wait_after_lease
- ovirt_vm - Fix parsing None arguments
- ovirt_vm - check if the snapshot exists
- hosted_engine_setup - make vdsm config cleanup optional
- hosted_engine_setup - Fix "'ansible' ModuleNotFoundError" in Disaster Recovery scripts
- hosted_engine_setup - Use command instead of firewalld module
* Fri Jun 3 2022 Martin Necas <mnecas@redhat.com> - 2.0.4-1
- Fix the admin user name when using keycloak
- Use cryptography < 37.0.0, as 37.0.0 emits a warning that fails testing
- Use rstcheck < 3.5.0, as 3.5.0 emits a warning that fails testing
- cluster_upgrade - fix wait_condition
- hosted_engine_setup - Allocate 128MiB instead of 1GiB for he_metadata
- hosted_engine_setup - Collect logs also on failures in 03_hosted_engine_final_tasks.yml
- hosted_engine_setup - Fix keycloak activation/checking
- hosted_engine_setup - Require 'detail' to be 'Up'
- hosted_engine_setup - fix archive ownership
- infra - add warning for multiple storage connections
* Wed Apr 13 2022 Martin Necas <mnecas@redhat.com> - 2.0.3-1
- spec: Obsolete ansible < 2.10.0
- ovirt_vm - Fix creating a RAW VM from a COW template
- ovirt_affinity_group - Add affinity labels
- invenory - Fix url address
* Wed Apr 6 2022 Martin Necas <mnecas@redhat.com> - 2.0.2-1
- cluster_upgrade: fix upgrade progress log_progress task
* Tue Apr 5 2022 Martin Necas <mnecas@redhat.com> - 2.0.1-1
- ovirt_storage_domain: make storage_format optional
* Mon Apr 4 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-1
- ovirt_template: add boot_menu and bios_type
- roles: hosted_engine_setup - Add an option to set the storage format when createing a storage domain and use it
- spec: Add python38-ovirt-imageio-client requirement
* Fri Mar 25 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.9.BETA
- roles: hosted_engine_setup: Fix call to engine-psql for vds_spm_id
* Fri Mar 25 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.8.BETA
- roles: cluster_upgrade: Directly log progress to the cluster
- spec: Add collections requirements
* Thu Mar 24 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.7.BETA
- roles: hosted_engine_setup: Replace calls to psql as postgres with engine_psql.sh
- spec: Add python38 requirements
* Tue Mar 8 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.6.BETA
- roles: hosted_engine_setup: Make cloud-init removal airgapped compatible
- roles: hosted_engine_setup: Replace xml community module
- roles: hosted_engine_setup: Support disa stig profile
- roles: hosted_engine_setup: Use cat command instead of lookup
- roles: repositories: Add satellite support
- plugins: Remove unused imports
- ovirt_host: Add enroll_certificate
* Tue Feb 15 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.5.BETA
- spec: Remove ansible requirements
- roles: cluster_upgrade: Shutdown vms only on pinned to upgrade host
- roles: hosted_engine_setup: Fix default gateway variable name
* Tue Jan 25 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.4.BETA
- roles: cluster_upgrade: Add progress tracking/reporting
- roles: hosted_engine_setup: Adjust files permissions
- roles: hosted_engine_setup: Add an option to define OpenSCAP security profile name
- roles: engine_setup: Prepare answer files and default values for 4.5 release
- info - Add follow link url to api model links_summary
* Thu Dec 16 2021 Martin Perina <mperina@redhat.com> - 2.0.0-0.3.BETA
- roles: hosted_engine_setup: Set ownership of copied engine logs
- roles: hosted_engine_setup: Remove SPICE from graphic protocols
* Wed Dec 8 2021 Martin Perina <mperina@redhat.com> - 2.0.0-0.2.BETA
- Fix ovirt_storage_domain entity
- roles: hosted_engine_setup: check if abrt config files exists on HE deploy
- manageiq: deprecate role
- Fix remove_stale_lun whitespace
- ovirt_remove_stale_lun: Use add_host instead of delegate_to
- manageiq: add deprecation info
- ovirt_remove_stale_lun: Retry "multipath -f" while removing the LUNs
- engine_setup: skip pkg install in offline mode
- add virtio_scsi_multi_queues parameter to ovirt_vm
- Fix offline deployment
- ovirt_host: fix failed_state_after_reinstall condition
* Fri Dec 3 2021 Martin Necas <mnecas@redhat.com> - 2.0.0-0.1.BETA
- ovirt_disk - Use imageio client
* Fri Nov 26 2021 Martin Necas <mnecas@redhat.com> - 1.6.6-1
- ovirt_remove_stale_lun - Allow user to remove multiple LUNs
- ovirt_remove_stale_lun - Retry "multipath -f" while removing the LUNs
- manageiq - Add deprecation info
- info - Enable follow parameter
- info - bump deprecate version for fetch_nested and nested_attributes
- info - Rename follows to follow parameter and add alias
* Tue Oct 19 2021 Martin Necas <mnecas@redhat.com> - 1.6.5-1
- repositories - Update host and engine repositories to 4.4.9
* Mon Sep 27 2021 Martin Necas <mnecas@redhat.com> - 1.6.4-1
- repositories - Add no_log to redhat_subscription
* Tue Sep 21 2021 Martin Necas <mnecas@redhat.com> - 1.6.3-1
- repositories - Replace redhat_subscription and rhsm_repository with command
- gluster_heal_info - Replacing gluster module to CLI to support RHV automation hub
- image_template - Remove static no - unsupported in ansible 2.12
* Thu Aug 26 2021 Martin Necas <mnecas@redhat.com> - 1.6.2-1
- remove_stale_lun - Fix example for `remote_stale_lun` role to be able to run it from engine
* Wed Aug 25 2021 Martin Necas <mnecas@redhat.com> - 1.6.1-1
- ovirt_auth - Fix no_log token issue
- hosted_engine_setup - Use default bridge for IPv6 advertisements
* Wed Aug 11 2021 Martin Necas <mnecas@redhat.com> - 1.6.0-1
- remove_stale_lun - Add role for removing stale LUN
- readme - Update Ansible requirement
- ovirt_disk - Fix update_check with no VM
- ovirt_auth - Fix password and username requirements
- engine_setup - Wait for webserver up after engine-config reboot
- hosted_engine_setup - Update Ansible requirements in README
- hosted_engine_setup - Pause deployment on failure of 'engine-backup --mode=restore'
- hosted_engine_setup - Text change - Consistently use 'bootstrap engine VM'
- hosted_engine_setup - Align with ansible-lint 5.0.0
* Thu Jul 22 2021 Martin Necas <mnecas@redhat.com> - 1.5.4-1
- hosted_engine_setup - Allow FIPS on HE VM
- hosted_engine_setup - remove duplicate tasks
- hosted_engine_setup - Use forward network during an IPv6 deployment
- ovirt_permission - fix group search that has space in it's name
* Fri Jun 25 2021 Martin Necas <mnecas@redhat.com> - 1.5.3-1
- disaster_recovery - Don't rely on safe_eval being able to do math/concat
- hosted_engine_setup - Minor doc update
- hosted_engine_setup - Fix engine vm add_host for the target machine
* Wed Jun 23 2021 Martin Necas <mnecas@redhat.com> - 1.5.2-1
- ovirt_vm - Add default return value to check_placement_policy.
- hosted_engine_setup - Do not try to sync at end of full_execution.
* Thu Jun 17 2021 Martin Necas <mnecas@redhat.com> - 1.5.1-1
- hosted_engine_setup - Filter VLAN devices with bad names
- ovirt_vm - Add placement_policy_hosts
- infra - Add external_provider parameter on networks role of infra role
- hosted_engine_setup - use-ansible-host
- hosted_engine_setup - Remove cloud-init configuration
- ovirt inventory plugin - allow several valid values for the `plugin` key
* Fri Jun 4 2021 Martin Necas <mnecas@redhat.com> - 1.5.0-1
- ovirt_host - Update iscsi target struct
- infra - Storage fix parameters typo
- disaster_recovery - Change conf paths to relative paths
- hosted_engine_setup - Add pause option before engine-setup
- hosted_engine_setup - Align with ansible-lint 5.0.0
- hosted_engine_setup - Remove leftover code and omit parameters
- hosted_engine_setup - Use ovirt_host module to discover iscsi
* Fri Apr 23 2021 Martin Necas <mnecas@redhat.com> - 1.4.2-1
- repositories - Add ppc host
- repositories - Remove ansible channels from RHV 4.4
- infra - Remove storage connection target usage
- hosted_engine_setup - Fix the appliance distribution
- hosted_engine_setup - Add an error message for FIPS on CentOS
- ovirt_vm - Allow cluster migration
* Mon Mar 22 2021 Martin Necas <mnecas@redhat.com> - 1.4.1-1
- hosted_engine_setup - Fix auth revoke
* Tue Mar 16 2021 Martin Necas <mnecas@redhat.com> - 1.4.0-1
- cluster_upgrade - Add correlation-id header
- engine_setup - Add skip renew pki confirm
- examples - Add recipe for removing DM device
- hosted_engine_setup - Filter devices with unsupported bond mode
- infra - Add reboot host parameters
- ovirt_disk - Add SATA support
- ovirt_user - Add ssh_public_key
- Set auth options into argument spec definition
* Wed Feb 10 2021 Martin Necas <mnecas@redhat.com> - 1.3.1-1
- ovirt_host - Add reboot_after_installation option
- hosted_engine_setup - Disable reboot_after_installation
* Thu Jan 28 2021 Martin Necas <mnecas@redhat.com> - 1.3.0-1
- ovirt_system_option_info - Add new module
- ansible-builder - Update bindep
- hosted_engine_setup - Collect all engine /var/log
- hosted_engine_setup - Use ovirt_system_option_info instead of REST API
- ovirt_disk - Add install warning
- ovirt_info - Fragment add auth suboptions to documentation
* Mon Dec 14 2020 Martin Necas <mnecas@redhat.com> - 1.2.4-1
- infra - Allow remove of user without password
- inventory plugin - Correct os_type name
- ovirt_disk - automatically detect virtual size of qcow image
* Mon Nov 30 2020 Martin Necas <mnecas@redhat.com> - 1.2.3-1
- Add hosted_engine_setup after_add_host hook
- Add engine_setup restore files
* Thu Nov 12 2020 Martin Perina <mperina@redhat.com> - 1.2.2-1
- inventory plugin - Fix Python 2 timestamp issue
- hosted_engine_setup - Clean VNC encryption config
- RPM packaging - Add Provides to previous oVirt Ansible roles RPMs to
minimize upgrade issues
* Mon Nov 2 2020 Martin Necas <mnecas@redhat.com> - 1.2.1-1
- Split README for build and GitHub
- Add ovirt_repositories_disable_gpg_check to repositories
* Tue Oct 27 2020 Martin Necas <mnecas@redhat.com> - 1.2.0-1
- Fix ovirt_disk ignore moving of hosted engine disks
- Obsolete old roles
* Mon Oct 12 2020 Martin Necas <mnecas@redhat.com> - 1.2.0-0.2
- Add role disaster_recovery
- Fix engine_setup yum.conf
- Fix hosted_engine_setup - Allow uppercase characters in mac address
* Mon Oct 12 2020 Martin Necas <mnecas@redhat.com> - 1.2.0-0.2
- Add ovirt_vm_info current_cd
- Add ovirt_nic_info template
- Add ovirt_nic template_version
- Fix ovirt_disk move
- Fix ovirt inventory connection close
- Fix ovirt_vm rename q35_sea to q35_sea_bios
- Fix ovirt_vm template search
* Wed Sep 16 2020 Martin Necas <mnecas@redhat.com> - 1.2.0-0.1
- Add role cluster_upgrade
- Add role engine_setup
- Add role vm_infra
- Add role infra
- Add role manageiq
- Add role hosted_engine_setup
- Add role image_template
- Add role shutdown_env
* Mon Aug 17 2020 Martin Necas <mnecas@redhat.com> - 1.1.2-1
- Add ansible changelogs
* Wed Aug 12 2020 Martin Necas <mnecas@redhat.com> - 1.1.1-1
- Fix ovirt_permission FQCNs
* Wed Aug 12 2020 Martin Necas <mnecas@redhat.com> - 1.1.0-1
- Add ovirt_vm_os_info module
- Add ovirt_disk backup
- Add ovirt_disk autodetect size when uploading
- Add ovirt_host add ssh_port
- Add ovirt_network support of removing vlan_tag
- Fix ovirt_disk upload
* Thu Apr 9 2020 Martin Necas <mnecas@redhat.com> - 1.0.0-1
- Initial release

View File

@@ -0,0 +1,409 @@
%global namespace ovirt
%global collectionname ovirt
%global ansible_collections_dir ansible/collections/ansible_collections
Name: @PACKAGE_NAME@
Summary: Ansible collection to manage all ovirt modules and inventory
Version: @RPM_VERSION@
Release: @RPM_RELEASE@%{?release_suffix}%{?dist}
Source0: http://resources.ovirt.org/pub/src/@PACKAGE_NAME@/@PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz
License: ASL 2.0 and GPLv3+
BuildArch: noarch
Url: http://www.ovirt.org
BuildRequires: ansible-core
BuildRequires: ansible-test
%if 0%{?rhel} > 7 && 0%{?rhel} < 9
BuildRequires: glibc-langpack-en
%endif
Requires: ansible-core >= 2.12.0
Requires: ovirt-imageio-client
Requires: python3-ovirt-engine-sdk4 >= 4.5.0
Requires: python3-netaddr
Requires: python3-jmespath
Requires: python3-passlib
Requires: ansible-collection-ansible-netcommon
Requires: ansible-collection-ansible-posix
Requires: ansible-collection-ansible-utils
Requires: qemu-img
%if 0%{?rhel} < 9
Requires: python38-ovirt-imageio-client
Requires: python38-ovirt-engine-sdk4 >= 4.5.0
Requires: python38-netaddr
Requires: python38-jmespath
Requires: python38-passlib
%endif
Obsoletes: ansible < 2.10.0
Obsoletes: ovirt-ansible-cluster-upgrade
Obsoletes: ovirt-ansible-disaster-recovery
Obsoletes: ovirt-ansible-engine-setup
Obsoletes: ovirt-ansible-hosted-engine-setup
Obsoletes: ovirt-ansible-image-template
Obsoletes: ovirt-ansible-infra
Obsoletes: ovirt-ansible-manageiq
Obsoletes: ovirt-ansible-repositories
Obsoletes: ovirt-ansible-roles
Obsoletes: ovirt-ansible-shutdown-env
Obsoletes: ovirt-ansible-vm-infra
Provides: ovirt-ansible-cluster-upgrade
Provides: ovirt-ansible-disaster-recovery
Provides: ovirt-ansible-engine-setup
Provides: ovirt-ansible-hosted-engine-setup
Provides: ovirt-ansible-image-template
Provides: ovirt-ansible-infra
Provides: ovirt-ansible-manageiq
Provides: ovirt-ansible-repositories
Provides: ovirt-ansible-roles
Provides: ovirt-ansible-shutdown-env
Provides: ovirt-ansible-vm-infra
%description
This Ansible collection is to manage all ovirt modules and inventory
%prep
%setup -c -q
%build
%install
export PKG_DATA_DIR_ORIG=%{_datadir}/%{ansible_collections_dir}
export PKG_DATA_DIR=%{buildroot}$PKG_DATA_DIR_ORIG
export PKG_DOC_DIR=%{buildroot}%{_pkgdocdir}
sh build.sh install %{collectionname}
%files
%{_datadir}/%{ansible_collections_dir}/%{namespace}
%if "%{collectionname}" == "rhv"
%{_datadir}/%{ansible_collections_dir}/ovirt
%endif
%doc README.md
%doc examples/
%license licenses
%changelog
* Tue Nov 15 2022 Martin Necas <mnecas@redhat.com> - 2.4.0-1
- cluster_upgrade - Add default random uuid to engine_correlation_id
- image_template - Add template_bios_type
* Thu Oct 27 2022 Martin Necas <mnecas@redhat.com> - 2.3.1-1
- filters - Fix ovirtvmipsv4 with attribute and network
- filters - Fix ovirtvmipsv4 with filter to list
- ovirt_host - Fix kernel_params elemets type
* Thu Oct 13 2022 Martin Necas <mnecas@redhat.com> - 2.3.0-1
- ovirt_host - Honor activate and reboot_after_installation when they are set to false with reinstalled host state
- ovirt_disk - Add read_only param for disk attachments
- ovirt_disk - Fix disk attachment to VM
- filters - Add documentation to all filters
- filters- Fix ovirtvmipsv4 when using attribute
- he-setup - Fix static ipv6 ifcfg setup
- repositories - RHV 4.4 SP1 is supported only on RHEL 8.6 EUS
* Mon Aug 15 2022 Martin Necas <mnecas@redhat.com> - 2.2.3-1
- cluster_upgrade - Skip host upgrades without anything to update
- hosted_engine_setup - Fix ovirt-provider-ovn-driver broken link
- hosted_engine_setup - restore - Remove host also based on name
- repositories - Fix example variable names
* Tue Aug 9 2022 Martin Necas <mnecas@redhat.com> - 2.2.2-1
- hosted_engine_setup - Detect hosted-engine-ha version using /usr/libexec/platform-python
- hosted_engine_setup - update ansible version in README
- repositories - Add mod_auth_openidc:2.3 and nodejs:14 to dnf modules
* Wed Aug 3 2022 Martin Necas <mnecas@redhat.com> - 2.2.1-1
- hosted_engine_setup - Fix hosted-engine.conf permissions and ownership
- hosted_engine_setup - During he_setup, configure ovn with he_host_address
* Mon Jul 25 2022 Martin Necas <mnecas@redhat.com> - 2.2.0-1
- cluster_upgrade - Fix starting up pinned vms
- disaster_recovery - Fix ansible-lint version 6.0.0 violations
- fix ansible-lint for basic roles(infra, vm_infra, engine_setup, repositories, cluster_upgrade)
- gluster_heal_info - Replacing gluster module to CLI to support RHV automation hub
- image_template - Remove static no - unsupported in ansible 2.12
- hosted_engine - During he_setup, configure ovn with he_host_name for correct operation of ovn
- hosted_engine - Handle migration to hosts that use systemd-coredump
- hosted_engine - Specify fqcn for ovirt_system_option_info
- hosted_engine - Align role with ansible-lint-6.0
- hosted_engine - Fix cleanup on el9
- ovirt_disk - Add warning for disk attachments
- ovirt_disk - Fix disk attachment to VM
- ovirt_disk - Updating the documentation - vm_name/vm_id and/or disk id parameter(s) are required when extending disk with non-unique name
- ovirt_host - Fix host wait
- ovirt_host - Fix restarted wait condition
- ovirt_qos, ovirt_disk_profile, ovirt_disk - Add modules to allow for creation and updating of disk_profiles
- ovirt_snapshot - Add vm_id to select VM
- ovirt_storage_domain - Fix inaccessible exception
- ovirt_vm - Add reset of VM
- ovirt_vm - Add virtio_scsi_enabled and multi_queues_enabled
- ovirt_vm - Add volatile
- ovirt_vm - Check if user inputed graphical protocol
- remove_stale_lun - Fix ansible-lint version 6.0.0 violations
- repositories - Add ovirt_repositories_rhsm_environment and FIPS fix
- repositories - Replace redhat_subscription and rhsm_repository with command
- repositories - Move fips check to satellite CA install block
- shutdown_env - Align role with ansible-lint-6.0.0
* Thu Jun 9 2022 Martin Necas <mnecas@redhat.com> - 2.1.0-1
- Add convert_to_bytes filter
- automation - Use python38 on el8 with ansible-core 2.12 and python39 on el9 with ansible-core 2.13
- engine_setup - Allow to disable cert validation
- ovirt - Remove deprecated distutils
- ovirt_vm - add wait_after_lease
- ovirt_vm - Fix parsing None arguments
- ovirt_vm - check if the snapshot exists
- hosted_engine_setup - make vdsm config cleanup optional
- hosted_engine_setup - Fix "'ansible' ModuleNotFoundError" in Disaster Recovery scripts
- hosted_engine_setup - Use command instead of firewalld module
* Fri Jun 3 2022 Martin Necas <mnecas@redhat.com> - 2.0.4-1
- Fix the admin user name when using keycloak
- Use cryptography < 37.0.0, as 37.0.0 emits a warning that fails testing
- Use rstcheck < 3.5.0, as 3.5.0 emits a warning that fails testing
- cluster_upgrade - fix wait_condition
- hosted_engine_setup - Allocate 128MiB instead of 1GiB for he_metadata
- hosted_engine_setup - Collect logs also on failures in 03_hosted_engine_final_tasks.yml
- hosted_engine_setup - Fix keycloak activation/checking
- hosted_engine_setup - Require 'detail' to be 'Up'
- hosted_engine_setup - fix archive ownership
- infra - add warning for multiple storage connections
* Wed Apr 13 2022 Martin Necas <mnecas@redhat.com> - 2.0.3-1
- spec: Obsolete ansible < 2.10.0
- ovirt_vm - Fix creating a RAW VM from a COW template
- ovirt_affinity_group - Add affinity labels
- invenory - Fix url address
* Wed Apr 6 2022 Martin Necas <mnecas@redhat.com> - 2.0.2-1
- cluster_upgrade: fix upgrade progress log_progress task
* Tue Apr 5 2022 Martin Necas <mnecas@redhat.com> - 2.0.1-1
- ovirt_storage_domain: make storage_format optional
* Mon Apr 4 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-1
- ovirt_template: add boot_menu and bios_type
- roles: hosted_engine_setup - Add an option to set the storage format when createing a storage domain and use it
- spec: Add python38-ovirt-imageio-client requirement
* Fri Mar 25 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.9.BETA
- roles: hosted_engine_setup: Fix call to engine-psql for vds_spm_id
* Fri Mar 25 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.8.BETA
- roles: cluster_upgrade: Directly log progress to the cluster
- spec: Add collections requirements
* Thu Mar 24 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.7.BETA
- roles: hosted_engine_setup: Replace calls to psql as postgres with engine_psql.sh
- spec: Add python38 requirements
* Tue Mar 8 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.6.BETA
- roles: hosted_engine_setup: Make cloud-init removal airgapped compatible
- roles: hosted_engine_setup: Replace xml community module
- roles: hosted_engine_setup: Support disa stig profile
- roles: hosted_engine_setup: Use cat command instead of lookup
- roles: repositories: Add satellite support
- plugins: Remove unused imports
- ovirt_host: Add enroll_certificate
* Tue Feb 15 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.5.BETA
- spec: Remove ansible requirements
- roles: cluster_upgrade: Shutdown vms only on pinned to upgrade host
- roles: hosted_engine_setup: Fix default gateway variable name
* Tue Jan 25 2022 Martin Necas <mnecas@redhat.com> - 2.0.0-0.4.BETA
- roles: cluster_upgrade: Add progress tracking/reporting
- roles: hosted_engine_setup: Adjust files permissions
- roles: hosted_engine_setup: Add an option to define OpenSCAP security profile name
- roles: engine_setup: Prepare answer files and default values for 4.5 release
- info - Add follow link url to api model links_summary
* Thu Dec 16 2021 Martin Perina <mperina@redhat.com> - 2.0.0-0.3.BETA
- roles: hosted_engine_setup: Set ownership of copied engine logs
- roles: hosted_engine_setup: Remove SPICE from graphic protocols
* Wed Dec 8 2021 Martin Perina <mperina@redhat.com> - 2.0.0-0.2.BETA
- Fix ovirt_storage_domain entity
- roles: hosted_engine_setup: check if abrt config files exists on HE deploy
- manageiq: deprecate role
- Fix remove_stale_lun whitespace
- ovirt_remove_stale_lun: Use add_host instead of delegate_to
- manageiq: add deprecation info
- ovirt_remove_stale_lun: Retry "multipath -f" while removing the LUNs
- engine_setup: skip pkg install in offline mode
- add virtio_scsi_multi_queues parameter to ovirt_vm
- Fix offline deployment
- ovirt_host: fix failed_state_after_reinstall condition
* Fri Dec 3 2021 Martin Necas <mnecas@redhat.com> - 2.0.0-0.1.BETA
- ovirt_disk - Use imageio client
* Fri Nov 26 2021 Martin Necas <mnecas@redhat.com> - 1.6.6-1
- ovirt_remove_stale_lun - Allow user to remove multiple LUNs
- ovirt_remove_stale_lun - Retry "multipath -f" while removing the LUNs
- manageiq - Add deprecation info
- info - Enable follow parameter
- info - bump deprecate version for fetch_nested and nested_attributes
- info - Rename follows to follow parameter and add alias
* Tue Oct 19 2021 Martin Necas <mnecas@redhat.com> - 1.6.5-1
- repositories - Update host and engine repositories to 4.4.9
* Mon Sep 27 2021 Martin Necas <mnecas@redhat.com> - 1.6.4-1
- repositories - Add no_log to redhat_subscription
* Tue Sep 21 2021 Martin Necas <mnecas@redhat.com> - 1.6.3-1
- repositories - Replace redhat_subscription and rhsm_repository with command
- gluster_heal_info - Replacing gluster module to CLI to support RHV automation hub
- image_template - Remove static no - unsupported in ansible 2.12
* Thu Aug 26 2021 Martin Necas <mnecas@redhat.com> - 1.6.2-1
- remove_stale_lun - Fix example for `remote_stale_lun` role to be able to run it from engine
* Wed Aug 25 2021 Martin Necas <mnecas@redhat.com> - 1.6.1-1
- ovirt_auth - Fix no_log token issue
- hosted_engine_setup - Use default bridge for IPv6 advertisements
* Wed Aug 11 2021 Martin Necas <mnecas@redhat.com> - 1.6.0-1
- remove_stale_lun - Add role for removing stale LUN
- readme - Update Ansible requirement
- ovirt_disk - Fix update_check with no VM
- ovirt_auth - Fix password and username requirements
- engine_setup - Wait for webserver up after engine-config reboot
- hosted_engine_setup - Update Ansible requirements in README
- hosted_engine_setup - Pause deployment on failure of 'engine-backup --mode=restore'
- hosted_engine_setup - Text change - Consistently use 'bootstrap engine VM'
- hosted_engine_setup - Align with ansible-lint 5.0.0
* Thu Jul 22 2021 Martin Necas <mnecas@redhat.com> - 1.5.4-1
- hosted_engine_setup - Allow FIPS on HE VM
- hosted_engine_setup - remove duplicate tasks
- hosted_engine_setup - Use forward network during an IPv6 deployment
- ovirt_permission - fix group search that has space in it's name
* Fri Jun 25 2021 Martin Necas <mnecas@redhat.com> - 1.5.3-1
- disaster_recovery - Don't rely on safe_eval being able to do math/concat
- hosted_engine_setup - Minor doc update
- hosted_engine_setup - Fix engine vm add_host for the target machine
* Wed Jun 23 2021 Martin Necas <mnecas@redhat.com> - 1.5.2-1
- ovirt_vm - Add default return value to check_placement_policy.
- hosted_engine_setup - Do not try to sync at end of full_execution.
* Thu Jun 17 2021 Martin Necas <mnecas@redhat.com> - 1.5.1-1
- hosted_engine_setup - Filter VLAN devices with bad names
- ovirt_vm - Add placement_policy_hosts
- infra - Add external_provider parameter on networks role of infra role
- hosted_engine_setup - use-ansible-host
- hosted_engine_setup - Remove cloud-init configuration
- ovirt inventory plugin - allow several valid values for the `plugin` key
* Fri Jun 4 2021 Martin Necas <mnecas@redhat.com> - 1.5.0-1
- ovirt_host - Update iscsi target struct
- infra - Storage fix parameters typo
- disaster_recovery - Change conf paths to relative paths
- hosted_engine_setup - Add pause option before engine-setup
- hosted_engine_setup - Align with ansible-lint 5.0.0
- hosted_engine_setup - Remove leftover code and omit parameters
- hosted_engine_setup - Use ovirt_host module to discover iscsi
* Fri Apr 23 2021 Martin Necas <mnecas@redhat.com> - 1.4.2-1
- repositories - Add ppc host
- repositories - Remove ansible channels from RHV 4.4
- infra - Remove storage connection target usage
- hosted_engine_setup - Fix the appliance distribution
- hosted_engine_setup - Add an error message for FIPS on CentOS
- ovirt_vm - Allow cluster migration
* Mon Mar 22 2021 Martin Necas <mnecas@redhat.com> - 1.4.1-1
- hosted_engine_setup - Fix auth revoke
* Tue Mar 16 2021 Martin Necas <mnecas@redhat.com> - 1.4.0-1
- cluster_upgrade - Add correlation-id header
- engine_setup - Add skip renew pki confirm
- examples - Add recipe for removing DM device
- hosted_engine_setup - Filter devices with unsupported bond mode
- infra - Add reboot host parameters
- ovirt_disk - Add SATA support
- ovirt_user - Add ssh_public_key
- Set auth options into argument spec definition
* Wed Feb 10 2021 Martin Necas <mnecas@redhat.com> - 1.3.1-1
- ovirt_host - Add reboot_after_installation option
- hosted_engine_setup - Disable reboot_after_installation
* Thu Jan 28 2021 Martin Necas <mnecas@redhat.com> - 1.3.0-1
- ovirt_system_option_info - Add new module
- ansible-builder - Update bindep
- hosted_engine_setup - Collect all engine /var/log
- hosted_engine_setup - Use ovirt_system_option_info instead of REST API
- ovirt_disk - Add install warning
- ovirt_info - Fragment add auth suboptions to documentation
* Mon Dec 14 2020 Martin Necas <mnecas@redhat.com> - 1.2.4-1
- infra - Allow remove of user without password
- inventory plugin - Correct os_type name
- ovirt_disk - automatically detect virtual size of qcow image
* Mon Nov 30 2020 Martin Necas <mnecas@redhat.com> - 1.2.3-1
- Add hosted_engine_setup after_add_host hook
- Add engine_setup restore files
* Thu Nov 12 2020 Martin Perina <mperina@redhat.com> - 1.2.2-1
- inventory plugin - Fix Python 2 timestamp issue
- hosted_engine_setup - Clean VNC encryption config
- RPM packaging - Add Provides to previous oVirt Ansible roles RPMs to
minimize upgrade issues
* Mon Nov 2 2020 Martin Necas <mnecas@redhat.com> - 1.2.1-1
- Split README for build and GitHub
- Add ovirt_repositories_disable_gpg_check to repositories
* Tue Oct 27 2020 Martin Necas <mnecas@redhat.com> - 1.2.0-1
- Fix ovirt_disk ignore moving of hosted engine disks
- Obsolete old roles
* Mon Oct 12 2020 Martin Necas <mnecas@redhat.com> - 1.2.0-0.2
- Add role disaster_recovery
- Fix engine_setup yum.conf
- Fix hosted_engine_setup - Allow uppercase characters in mac address
* Mon Oct 12 2020 Martin Necas <mnecas@redhat.com> - 1.2.0-0.2
- Add ovirt_vm_info current_cd
- Add ovirt_nic_info template
- Add ovirt_nic template_version
- Fix ovirt_disk move
- Fix ovirt inventory connection close
- Fix ovirt_vm rename q35_sea to q35_sea_bios
- Fix ovirt_vm template search
* Wed Sep 16 2020 Martin Necas <mnecas@redhat.com> - 1.2.0-0.1
- Add role cluster_upgrade
- Add role engine_setup
- Add role vm_infra
- Add role infra
- Add role manageiq
- Add role hosted_engine_setup
- Add role image_template
- Add role shutdown_env
* Mon Aug 17 2020 Martin Necas <mnecas@redhat.com> - 1.1.2-1
- Add ansible changelogs
* Wed Aug 12 2020 Martin Necas <mnecas@redhat.com> - 1.1.1-1
- Fix ovirt_permission FQCNs
* Wed Aug 12 2020 Martin Necas <mnecas@redhat.com> - 1.1.0-1
- Add ovirt_vm_os_info module
- Add ovirt_disk backup
- Add ovirt_disk autodetect size when uploading
- Add ovirt_host add ssh_port
- Add ovirt_network support of removing vlan_tag
- Fix ovirt_disk upload
* Thu Apr 9 2020 Martin Necas <mnecas@redhat.com> - 1.0.0-1
- Initial release

View File

@@ -0,0 +1,57 @@
#!/usr/bin/python3
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback import CallbackBase
# Not only visible to ansible-doc, it also 'declares' the options the plugin
# requires and how to configure them.
# TODO Fix DOCUMENTATION to pass the ansible-test validate-modules
DOCUMENTATION = '''
callback: stdout
callback_type: aggregate
short_description: Output the log of ansible
version_added: "2.0"
description:
- This callback output the log of ansible play tasks.
'''
class CallbackModule(CallbackBase):
"""
This callback module output the information with a specific style.
"""
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'aggregate'
CALLBACK_NAME = 'stdout'
# only needed if you ship it and don't want to enable by default
CALLBACK_NEEDS_WHITELIST = False
def __init__(self):
# make sure the expected objects are present, calling the base's
# __init__
super(CallbackModule, self).__init__()
def runner_on_failed(self, host, res, ignore_errors=False):
self._display.display('FAILED: %s %s' % (host, res))
def runner_on_ok(self, host, res):
self._display.display('OK: %s %s' % (host, res))
def runner_on_skipped(self, host, item=None):
self._display.display('SKIPPED: %s' % host)
def runner_on_unreachable(self, host, res):
self._display.display('UNREACHABLE: %s %s' % (host, res))
def runner_on_async_failed(self, host, res, jid):
self._display.display('ASYNC_FAILED: %s %s %s' % (host, res, jid))
def playbook_on_import_for_host(self, host, imported_file):
self._display.display('IMPORTED: %s %s' % (host, imported_file))
def playbook_on_not_import_for_host(self, host, missing_file):
self._display.display('NOTIMPORTED: %s %s' % (host, missing_file))

View File

@@ -0,0 +1,111 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
# Standard oVirt documentation fragment
DOCUMENTATION = r'''
options:
wait:
description:
- "C(yes) if the module should wait for the entity to get into desired state."
type: bool
default: yes
fetch_nested:
description:
- "If I(True) the module will fetch additional data from the API."
- "It will fetch IDs of the VMs disks, snapshots, etc. User can configure to fetch other
attributes of the nested entities by specifying C(nested_attributes)."
type: bool
default: false
nested_attributes:
description:
- "Specifies list of the attributes which should be fetched from the API."
- "This parameter apply only when C(fetch_nested) is I(true)."
type: list
elements: str
auth:
description:
- "Dictionary with values needed to create HTTP/HTTPS connection to oVirt:"
suboptions:
username:
description:
- The name of the user, something like I(admin@internal).
- Default value is set by C(OVIRT_USERNAME) environment variable.
type: str
password:
description:
- The password of the user.
- Default value is set by C(OVIRT_PASSWORD) environment variable.
type: str
url:
description:
- A string containing the API URL of the server, usually something like `I(https://server.example.com/ovirt-engine/api)`.
- Default value is set by C(OVIRT_URL) environment variable.
- Either C(url) or C(hostname) is required.
type: str
hostname:
description:
- A string containing the hostname of the server, usually something like `I(server.example.com)`.
- Default value is set by C(OVIRT_HOSTNAME) environment variable.
- Either C(url) or C(hostname) is required.
type: str
token:
description:
- Token to be used instead of login with username/password.
- Default value is set by C(OVIRT_TOKEN) environment variable.
type: str
insecure:
description:
- A boolean flag that indicates if the server TLS certificate and host name should be checked.
type: bool
default: false
ca_file:
description:
- A PEM file containing the trusted CA certificates.
- The certificate presented by the server will be verified using these CA certificates.
- If C(ca_file) parameter is not set, system wide CA certificate store is used.
- Default value is set by C(OVIRT_CAFILE) environment variable.
type: str
kerberos:
description:
- A boolean flag indicating if Kerberos authentication should be used instead of the default basic authentication.
type: bool
headers:
description:
- Dictionary of HTTP headers to be added to each API call.
type: dict
timeout:
description: Number of seconds to wait for response.
type: int
compress:
description: Flag indicating if compression is used for connection.
type: bool
default: true
type: dict
required: true
timeout:
description:
- "The amount of time in seconds the module should wait for the instance to
get into desired state."
type: int
default: 180
poll_interval:
description:
- "Number of the seconds the module waits until another poll request on entity status is sent."
type: int
default: 3
requirements:
- python >= 2.7
- ovirt-engine-sdk-python >= 4.4.0
notes:
- "In order to use this module you have to install oVirt Python SDK.
To ensure it's installed with correct version you can create the following task:
I(pip: name=ovirt-engine-sdk-python version=4.4.0)"
'''

View File

@@ -0,0 +1,98 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):
# info standard oVirt documentation fragment
DOCUMENTATION = r'''
options:
fetch_nested:
description:
- If I(yes) the module will fetch additional data from the API.
- It will fetch only IDs of nested entity. It doesn't fetch multiple levels of nested attributes.
Only the attributes of the current entity. User can configure to fetch other
attributes of the nested entities by specifying C(nested_attributes).
- This parameter is deprecated and replaced by C(follow).
type: bool
default: false
nested_attributes:
description:
- Specifies list of the attributes which should be fetched from the API.
- This parameter apply only when C(fetch_nested) is I(true).
- This parameter is deprecated and replaced by C(follow).
type: list
elements: str
auth:
description:
- "Dictionary with values needed to create HTTP/HTTPS connection to oVirt:"
suboptions:
username:
description:
- The name of the user, something like I(admin@internal).
- Default value is set by C(OVIRT_USERNAME) environment variable.
type: str
password:
description:
- The password of the user.
- Default value is set by C(OVIRT_PASSWORD) environment variable.
type: str
url:
description:
- A string containing the API URL of the server, usually something like `I(https://server.example.com/ovirt-engine/api)`.
- Default value is set by C(OVIRT_URL) environment variable.
- Either C(url) or C(hostname) is required.
type: str
hostname:
description:
- A string containing the hostname of the server, usually something like `I(server.example.com)`.
- Default value is set by C(OVIRT_HOSTNAME) environment variable.
- Either C(url) or C(hostname) is required.
type: str
token:
description:
- Token to be used instead of login with username/password.
- Default value is set by C(OVIRT_TOKEN) environment variable.
type: str
insecure:
description:
- A boolean flag that indicates if the server TLS certificate and host name should be checked.
type: bool
default: false
ca_file:
description:
- A PEM file containing the trusted CA certificates.
- The certificate presented by the server will be verified using these CA certificates.
- If C(ca_file) parameter is not set, system wide CA certificate store is used.
- Default value is set by C(OVIRT_CAFILE) environment variable.
type: str
kerberos:
description:
- A boolean flag indicating if Kerberos authentication should be used instead of the default basic authentication.
type: bool
headers:
description:
- Dictionary of HTTP headers to be added to each API call.
type: dict
timeout:
description: Number of seconds to wait for response.
type: int
compress:
description: Flag indicating if compression is used for connection.
type: bool
default: true
type: dict
required: true
requirements:
- python >= 2.7
- ovirt-engine-sdk-python >= 4.4.0
notes:
- "In order to use this module you have to install oVirt Python SDK.
To ensure it's installed with correct version you can create the following task:
pip: name=ovirt-engine-sdk-python version=4.4.0"
'''

View File

@@ -0,0 +1,21 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.ovirt.ovirt.plugins.module_utils.ovirt import convert_to_bytes
class FilterModule(object):
def filters(self):
'Define filters'
return {
'convert_to_bytes': self.convert_to_bytes,
}
def convert_to_bytes(self, param):
"""
Filter to convert units to bytes, which follow IEC standard.
:param param: value to be converted
"""
return convert_to_bytes(param)

View File

@@ -0,0 +1,22 @@
DOCUMENTATION:
name: convert_to_bytes
author: Martin Necas (@mnecas)
# version_added: 'historical'
short_description: Convert units to bytes
description:
- This method convert units to bytes, which follow IEC standard
positional: _input
options:
_input:
description: Value to be converted
type: string
required: true
EXAMPLES: |
- name: Get number of bytes
ansible.builtin.set_fact:
disk_size: "{{ '1KiB' | ovirt.ovirt.convert_to_bytes }}"
RETURN:
_value:
description: Amount of bytes
type: int

View File

@@ -0,0 +1,30 @@
DOCUMENTATION:
name: filtervalue
author: Martin Necas (@mnecas)
short_description: Filter to findall occurance of some value in dict
description:
- Filter to findall occurance of some value in dict
positional: _input, attr, value
options:
_input:
description: List of VMs
type: list
required: true
attr:
description: Attribute to sotr by
type: list
required: true
value:
description: List of VMs
type: list
required: true
EXAMPLES: |
- name: Set filtred ovirt_vms
ansible.builtin.set_fact:
ovirt_vms: "{{ vms | ovirt.ovirt.filtervalue('name', item.name) }}"
RETURN:
_value:
description: Filtred VMs
type: list

View File

@@ -0,0 +1,22 @@
DOCUMENTATION:
name: get_network_xml_to_dict
author: Martin Necas (@mnecas)
short_description: Get network bridge and uuid to dict
description:
- Get network bridge and uuid to dict
positional: _input
options:
_input:
description: xml
type: string
required: true
EXAMPLES: |
- name: Set network_dict from default_net_xml
ansible.builtin.set_fact:
network_dict: "{{ default_net_xml['stdout'] | ovirt.ovirt.get_network_xml_to_dict }}"
RETURN:
_value:
description: Dict of network
type: dict

View File

@@ -0,0 +1,31 @@
"Module to create filter to find ovf disk size from xml"
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleFilterError
import xml.etree.ElementTree as ET
def get_ovf_disk_size(data):
try:
root = ET.fromstring(data)
for child in root:
for element in child:
if element.tag == "Disk":
return element.attrib.get(
"{http://schemas.dmtf.org/ovf/envelope/1/}size"
)
except Exception as e:
raise AnsibleFilterError(
"Error in get_ovf_disk_size filter plugin:\n%s" % e
)
class FilterModule(object):
"""OVF disk size filter"""
def filters(self):
return {
"get_ovf_disk_size": get_ovf_disk_size
}

View File

@@ -0,0 +1,25 @@
DOCUMENTATION:
name: get_ovf_disk_size
author: Asaf Rachmani (@arachmani)
# version_added: 'historical'
short_description: Get OVF disk size
description:
- Get OVF disk size.
positional: _input
options:
_input:
description: OVF data
type: string
required: true
EXAMPLES: |
- name: Get ovf data
ansible.builtin.command: cat "{{ path }}"
register: ovf_data
- name: Get disk size from ovf data
ansible.builtin.set_fact:
disk_size: "{{ ovf_data['stdout'] | ovirt.ovirt.get_ovf_disk_size }}"
RETURN:
_value:
description: OVF disk size
type: string

View File

@@ -0,0 +1,59 @@
# -*- coding: utf-8 -*-
# (c) 2015, Filipe Niero Felisbino <filipenf@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError, AnsibleFilterError
try:
import jmespath
HAS_LIB = True
except ImportError:
HAS_LIB = False
def json_query(data, expr):
'''Query data using jmespath query language ( http://jmespath.org ). Example:
- ansible.builtin.debug: msg="{{ instance | json_query(tagged_instances[*].block_device_mapping.*.volume_id') }}"
'''
if not HAS_LIB:
raise AnsibleError('You need to install "jmespath" prior to running '
'json_query filter')
# Hack to handle Ansible Unsafe text, AnsibleMapping and AnsibleSequence
# See issue: https://github.com/ansible-collections/community.general/issues/320
jmespath.functions.REVERSE_TYPES_MAP['string'] = jmespath.functions.REVERSE_TYPES_MAP['string'] + ('AnsibleUnicode', 'AnsibleUnsafeText', )
jmespath.functions.REVERSE_TYPES_MAP['array'] = jmespath.functions.REVERSE_TYPES_MAP['array'] + ('AnsibleSequence', )
jmespath.functions.REVERSE_TYPES_MAP['object'] = jmespath.functions.REVERSE_TYPES_MAP['object'] + ('AnsibleMapping', )
try:
return jmespath.search(expr, data)
except jmespath.exceptions.JMESPathError as e:
raise AnsibleFilterError('JMESPathError in json_query filter plugin:\n%s' % e)
except Exception as e:
# For older jmespath, we can get ValueError and TypeError without much info.
raise AnsibleFilterError('Error in jmespath.search in json_query filter plugin:\n%s' % e)
class FilterModule(object):
''' Query filter '''
def filters(self):
return {
'json_query': json_query
}

View File

@@ -0,0 +1,20 @@
DOCUMENTATION:
name: json_query
short_description: Copy of community.general.json_query
description:
- Copy of community.general.json_query used internally in the collection to ease RPM packaging, so we don't need to package/release/support the whole community.general collection for RHV customers
- The original can be found at link https://github.com/ansible-collections/community.general/blob/main/plugins/filter/json_query.py
positional: _input
options:
_input:
description: Value to be converted
type: string
required: true
EXAMPLES: |
Query data using jmespath query language ( http://jmespath.org ). Example:
- ansible.builtin.debug: msg="{{ instance | json_query(tagged_instances[*].block_device_mapping.*.volume_id') }}"
RETURN:
_value:
description: query
type: string

View File

@@ -0,0 +1,35 @@
DOCUMENTATION:
name: ovirtdiff
author: Martin Necas (@mnecas)
short_description: Show what will be changed in next run of the VM
description:
- Show what will be changed in next run of the VM
positional: _input
options:
_input:
description: VM
type: dict
required: true
EXAMPLES: |
- name: Get VM myvm
ovirt_vm_info:
auth: "{{ ovirt_auth }}"
pattern: 'name={{ myvm }}'
next_run: false
register: vm
- name: Get next_run of VM myvm
ovirt_vm_info:
auth: "{{ ovirt_auth }}"
pattern: 'name={{ myvm }}'
next_run: true
register: vm_next_run
- name: Print what will be changed in next run of the VM
debug:
msg: "{{ vm.ovirt_vms[0] | ovirt.ovirt.ovirtdiff(vm_next_run.ovirt_vms[0]) }}"
RETURN:
_value:
description: VM
type: dict

View File

@@ -0,0 +1,158 @@
'Module to create filter to find IP addresses in VMs'
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from xml.etree import ElementTree
class FilterModule(object):
'Filter for IP addresses on newly created VMs'
def filters(self):
'Define filters'
return {
'ovirtvmip': self.ovirtvmip,
'ovirtvmips': self.ovirtvmips,
'ovirtvmipv4': self.ovirtvmipv4,
'ovirtvmipsv4': self.ovirtvmipsv4,
'ovirtvmipv6': self.ovirtvmipv6,
'ovirtvmipsv6': self.ovirtvmipsv6,
'filtervalue': self.filtervalue,
'removesensitivevmdata': self.removesensitivevmdata,
'ovirtdiff': self.ovirtdiff,
'get_network_xml_to_dict': self.get_network_xml_to_dict,
}
def ovirtdiff(self, vm1, vm2):
"""
This filter takes two dictionaries of two different resources and compare
them. It return dictionari with keys 'before' and 'after', where 'before'
containes old values of resources and 'after' contains new values.
This is mainly good to compare current VM object and next run VM object to see
the difference for the next_run.
"""
before = []
after = []
if vm1.get('next_run_configuration_exists'):
keys = [
key for key in set(list(vm1.keys()) + list(vm2.keys()))
if (key in vm1 and (key not in vm2 or vm2[key] != vm1[key])) or (key in vm2 and (key not in vm1 or vm1[key] != vm2[key]))
]
for key in keys:
before.append((key, vm1.get(key)))
after.append((key, vm2.get(key, vm1.get(key))))
return {
'before': dict(before),
'after': dict(after),
}
def filtervalue(self, data, attr, value):
""" Filter to findall occurance of some value in dict """
items = []
for item in data:
if item[attr] == value:
items.append(item)
return items
def ovirtvmip(self, ovirt_vms, attr=None, network_ip=None):
'Return first IP'
return self.__get_first_ip(self.ovirtvmips(ovirt_vms, attr))
def ovirtvmips(self, ovirt_vms, attr=None, network_ip=None):
'Return list of IPs'
return self._parse_ips(ovirt_vms, attr=attr)
def ovirtvmipv4(self, ovirt_vms, attr=None, network_ip=None):
'Return first IPv4 IP'
return self.__get_first_ip(self.ovirtvmipsv4(ovirt_vms, attr, network_ip))
def ovirtvmipsv4(self, ovirt_vms, attr=None, network_ip=None):
'Return list of IPv4 IPs'
ips = self._parse_ips(ovirt_vms, lambda version: version == 'v4', attr)
if attr:
return dict((k, list(filter(lambda x: self.__address_in_network(x, network_ip), v))) for k, v in ips.items())
return list(filter(lambda x: self.__address_in_network(x, network_ip), ips))
def ovirtvmipv6(self, ovirt_vms, attr=None, network_ip=None):
'Return first IPv6 IP'
return self.__get_first_ip(self.ovirtvmipsv6(ovirt_vms, attr))
def ovirtvmipsv6(self, ovirt_vms, attr=None, network_ip=None):
'Return list of IPv6 IPs'
return self._parse_ips(ovirt_vms, lambda version: version == 'v6', attr)
def _parse_ips(self, ovirt_vms, version_condition=lambda version: True, attr=None):
if not isinstance(ovirt_vms, list):
ovirt_vms = [ovirt_vms]
if attr is None:
return self._parse_ips_aslist(ovirt_vms, version_condition)
else:
return self._parse_ips_asdict(ovirt_vms, version_condition, attr)
@staticmethod
def _parse_ips_asdict(ovirt_vms, version_condition=lambda version: True, attr=None):
vm_ips = {}
for ovirt_vm in ovirt_vms:
ips = []
for device in ovirt_vm.get('reported_devices', []):
for curr_ip in device.get('ips', []):
if version_condition(curr_ip.get('version')):
ips.append(curr_ip.get('address'))
vm_ips[ovirt_vm.get(attr)] = ips
return vm_ips
@staticmethod
def _parse_ips_aslist(ovirt_vms, version_condition=lambda version: True):
ips = []
for ovirt_vm in ovirt_vms:
for device in ovirt_vm.get('reported_devices', []):
for curr_ip in device.get('ips', []):
if version_condition(curr_ip.get('version')):
ips.append(curr_ip.get('address'))
return ips
@staticmethod
def __get_first_ip(res):
return res[0] if isinstance(res, list) and res else res
def __address_in_network(self, ip, net):
"Return boolean if IP is in network."
if net:
ipaddr = int(''.join(['%02x' % int(x) for x in ip.split('.')]), 16)
netstr, bits = net.split('/')
netaddr = int(''.join(['%02x' % int(x)
for x in netstr.split('.')]), 16)
mask = (0xffffffff << (32 - int(bits))) & 0xffffffff
return (ipaddr & mask) == (netaddr & mask)
return True
def removesensitivevmdata(self, data, key_to_remove='root_password'):
for value in data:
if key_to_remove in value:
value[key_to_remove] = "******"
if 'cloud_init' in value and key_to_remove in value['cloud_init']:
value['cloud_init'][key_to_remove] = "******"
if 'sysprep' in value and key_to_remove in value['sysprep']:
value['sysprep'][key_to_remove] = "******"
if 'profile' in value:
profile = value['profile']
if key_to_remove in profile:
profile[key_to_remove] = "******"
if 'cloud_init' in profile and key_to_remove in profile['cloud_init']:
profile['cloud_init'][key_to_remove] = "******"
if 'sysprep' in profile and key_to_remove in profile['sysprep']:
profile['sysprep'][key_to_remove] = "******"
return data
def get_network_xml_to_dict(self, data):
tree = ElementTree.fromstring(data)
resp = {}
for child in tree:
if child.tag == 'bridge':
resp['bridge'] = child.attrib
if child.tag == 'uuid':
resp['uuid'] = child.text
return resp

View File

@@ -0,0 +1,31 @@
DOCUMENTATION:
name: ovirtvmip
author: Martin Necas (@mnecas)
short_description: Return first IP
description:
- Return first IP
positional: _input, attr, network_ip
options:
_input:
description: List of VMs
type: list
required: true
attr:
description: Attribute by which the
type: list
network_ip:
description: Filter the IPs by network address
type: string
EXAMPLES: |
- name: Print VM IP
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmip }}"
- name: Print VM IP
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmip(attr='name') }}"
RETURN:
_value:
description: First IP
type: list

View File

@@ -0,0 +1,31 @@
DOCUMENTATION:
name: ovirtvmips
author: Martin Necas (@mnecas)
short_description: VM all IPs
description:
- VM all IPs
positional: _input
options:
_input:
description: List of VMs
type: list
required: true
attr:
description: Attribute by which the
type: list
network_ip:
description: Filter the IPs by network address
type: string
EXAMPLES: |
- name: Print VM all IPs
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmips }}"
- name: Print VM all IPs
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmips(attr='name') }}"
RETURN:
_value:
description: All IPs
type: list

View File

@@ -0,0 +1,31 @@
DOCUMENTATION:
name: ovirtvmipsv4
author: Martin Necas (@mnecas)
short_description: VM IPv4
description:
- VM IPv4
positional: _input
options:
_input:
description: List of VMs
type: list
required: true
attr:
description: Attribute by which the
type: list
network_ip:
description: Filter the IPs by network address
type: string
EXAMPLES: |
- name: Print VM all IPv4
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipsv4 }}"
- name: Print VM all IPv4
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipsv4(attr='name') }}"
RETURN:
_value:
description: VM IPv4
type: list

View File

@@ -0,0 +1,31 @@
DOCUMENTATION:
name: ovirtvmipsv6
author: Martin Necas (@mnecas)
short_description: VM IPv4
description:
- VM IPv4
positional: _input
options:
_input:
description: List of VMs
type: list
required: true
attr:
description: Attribute by which the
type: list
network_ip:
description: Filter the IPs by network address
type: string
EXAMPLES: |
- name: Print VM all IPv6
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipsv6 }}"
- name: Print VM all IPv6
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipsv6(attr='name') }}"
RETURN:
_value:
description: VM IPv4
type: list

View File

@@ -0,0 +1,31 @@
DOCUMENTATION:
name: ovirtvmipv4
author: Martin Necas (@mnecas)
short_description: VM IPv4
description:
- VM IPv4
positional: _input
options:
_input:
description: List of VMs
type: list
required: true
attr:
description: Attribute by which the
type: list
network_ip:
description: Filter the IPs by network address
type: string
EXAMPLES: |
- name: Print VM IPv4
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipv4 }}"
- name: Print VM IPv4
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipv4(attr='name') }}"
RETURN:
_value:
description: VM IPv4
type: list

View File

@@ -0,0 +1,31 @@
DOCUMENTATION:
name: ovirtvmipv6
author: Martin Necas (@mnecas)
short_description: VM IPv4
description:
- VM IPv4
positional: _input
options:
_input:
description: List of VMs
type: list
required: true
attr:
description: Attribute by which the
type: list
network_ip:
description: Filter the IPs by network address
type: string
EXAMPLES: |
- name: Print VM IPv6
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipv6 }}"
- name: Print VM IPv6
debug:
msg: "{{ vms.ovirt_vms | ovirt.ovirt.ovirtvmipv6(attr='name') }}"
RETURN:
_value:
description: VM IPv4
type: list

View File

@@ -0,0 +1,22 @@
DOCUMENTATION:
name: removesensitivevmdata
author: Martin Necas (@mnecas)
short_description: removesensitivevmdata internal filter
description:
- removesensitivevmdata internal filter
positional: _input
options:
_input:
description: List of VMs
type: list
required: true
EXAMPLES: |
- name: Print VM
debug:
msg: "{{ vms | ovirt.ovirt.removesensitivevmdata }}"
RETURN:
_value:
description: List of VMs
type: list

View File

@@ -0,0 +1,272 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
# TODO Fix DOCUMENTATION to pass the ansible-test validate-modules
DOCUMENTATION = '''
name: ovirt
plugin_type: inventory
short_description: oVirt inventory source
version_added: "1.0.0"
author: Bram Verschueren (@bverschueren)
requirements:
- ovirt-engine-sdk-python >= 4.2.4
extends_documentation_fragment:
- inventory_cache
- constructed
description:
- Get inventory hosts from the ovirt service.
- Requires a YAML file ending in 'ovirt.yml', 'ovirt4.yml', 'ovirt.yaml', 'ovirt4.yaml'.
options:
plugin:
description: the name of this plugin, it should always be set to 'ovirt' for this plugin to recognise it as it's own.
required: True
choices: ['ovirt', 'ovirt.ovirt.ovirt', 'redhat.rhv.ovirt']
ovirt_url:
description: URL to ovirt-engine API.
required: True
env:
- name: OVIRT_URL
ovirt_username:
description: ovirt authentication user.
required: True
env:
- name: OVIRT_USERNAME
ovirt_password:
description: ovirt authentication password.
required : True
env:
- name: OVIRT_PASSWORD
ovirt_cafile:
description: path to ovirt-engine CA file. If C(ovirt_cafile) parameter is not set and C(ovirt_insecure) is not True, system wide CA certificate store\
is used.
required: False
ovirt_insecure:
description: A boolean flag that indicates if the server TLS certificate and host name should be checked.
required: False
ovirt_query_filter:
required: False
description: dictionary of filter key-values to query VM's. See U(https://ovirt.github.io/ovirt-engine-sdk/master/services.m.html#ovirtsdk4\
.services.VmsService.list) for filter parameters.
ovirt_hostname_preference:
required: False
description:
- List of options that describe the ordering for which hostnames should be assigned.
- See U(https://ovirt.github.io/ovirt-engine-api-model/master/#types/vm) for available attributes.
default: ['fqdn', 'name']
type: list
'''
EXAMPLES = '''
# Ensure the CA is available:
# $ wget "https://engine/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA" -O /path/to/ca.pem
# Sample content of ovirt.yml:
plugin: ovirt.ovirt.ovirt
ovirt_url: https://engine/ovirt-engine/api
ovirt_cafile: /path/to/ca.pem
ovirt_username: ansible-tester
ovirt_password: secure
ovirt_query_filter:
search: 'name=myvm AND cluster=mycluster'
case_sensitive: no
max: 15
keyed_groups:
- key: cluster
prefix: 'cluster'
groups:
dev: "'dev' in tags"
compose:
ansible_host: devices["eth0"][0]
'''
import sys
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
from ansible.errors import AnsibleError, AnsibleParserError
HAS_OVIRT_LIB = False
try:
import ovirtsdk4 as sdk
HAS_OVIRT_LIB = True
except ImportError:
HAS_OVIRT_LIB = False
class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
NAME = 'ovirt.ovirt.ovirt'
def _get_dict_of_struct(self, vm):
''' Transform SDK Vm Struct type to Python dictionary.
:param vm: host struct of which to create dict
:return dict of vm struct type
'''
vms_service = self.connection.system_service().vms_service()
clusters_service = self.connection.system_service().clusters_service()
vm_service = vms_service.vm_service(vm.id)
devices = vm_service.reported_devices_service().list()
tags = vm_service.tags_service().list()
stats = vm_service.statistics_service().list()
labels = vm_service.affinity_labels_service().list()
groups = clusters_service.cluster_service(
vm.cluster.id
).affinity_groups_service().list()
return {
'id': vm.id,
'name': vm.name,
'host': self.connection.follow_link(vm.host).name if vm.host else None,
'cluster': self.connection.follow_link(vm.cluster).name,
'status': str(vm.status),
'description': vm.description,
'fqdn': vm.fqdn,
'os': vm.os.type,
'template': self.connection.follow_link(vm.template).name,
'creation_time': str(vm.creation_time),
'creation_time_timestamp': float(vm.creation_time.strftime("%s.%f")),
'tags': [tag.name for tag in tags],
'affinity_labels': [label.name for label in labels],
'affinity_groups': [
group.name for group in groups
if vm.name in [vm.name for vm in self.connection.follow_link(group.vms)]
],
'statistics': dict(
(stat.name, stat.values[0].datum if stat.values else None) for stat in stats
),
'devices': dict(
(device.name, [ip.address for ip in device.ips]) for device in devices if device.ips
),
}
def _query(self, query_filter=None):
'''
:param query_filter: dictionary of filter parameter/values
:return dict of oVirt vm dicts
'''
return [self._get_dict_of_struct(host) for host in self._get_hosts(query_filter=query_filter)]
def _get_hosts(self, query_filter=None):
'''
:param filter: dictionary of vm filter parameter/values
:return list of oVirt vm structs
'''
vms_service = self.connection.system_service().vms_service()
if query_filter is not None:
return vms_service.list(**query_filter)
return vms_service.list()
def _get_query_options(self, param_dict):
''' Get filter parameters and cast these to comply with sdk VmsService.list param types
:param param_dict: dictionary of filter parameters and values
:return dictionary with casted parameter/value
'''
if param_dict is None:
return None
FILTER_MAPPING = {
'all_content': bool,
'case_sensitive': bool,
'filter': bool,
'follow': str,
'max': int,
'search': str
}
casted_dict = {}
for (param, value) in param_dict.items():
try:
casted_dict[param] = FILTER_MAPPING[param](value)
except KeyError:
raise AnsibleError("Unknown filter option '{0}'".format(param))
return casted_dict
def _get_hostname(self, host):
'''
Get the host's hostname based on prefered attribute
:param host: dict representation of oVirt VmStruct
:param return: preferred hostname for the host
'''
hostname_preference = self.get_option('ovirt_hostname_preference')
if not hostname_preference:
raise AnsibleParserError('Invalid value for option ovirt_hostname_preference: {0}'.format(hostname_preference))
hostname = None
for preference in hostname_preference:
hostname = host.get(preference)
if hostname is not None:
return hostname
raise AnsibleParserError("No valid name found for host id={0}".format(host.get('id')))
def _populate_from_source(self, source_data):
for host in source_data:
hostname = self._get_hostname(host)
self.inventory.add_host(hostname)
for fact, value in host.items():
self.inventory.set_variable(hostname, fact, value)
strict = self.get_option('strict')
self._set_composite_vars(self.get_option('compose'), host, hostname, strict=strict)
self._add_host_to_composed_groups(self.get_option('groups'), host, hostname, strict=strict)
self._add_host_to_keyed_groups(self.get_option('keyed_groups'), host, hostname, strict=strict)
def verify_file(self, path):
valid = False
if super(InventoryModule, self).verify_file(path):
if path.endswith(('ovirt.yml', 'ovirt4.yml', 'ovirt.yaml', 'ovirt4.yaml')):
valid = True
return valid
def parse(self, inventory, loader, path, cache=True):
if not HAS_OVIRT_LIB:
raise AnsibleError('oVirt inventory script requires ovirt-engine-sdk-python >= 4.2.4')
super(InventoryModule, self).parse(inventory, loader, path, cache)
config = self._read_config_data(path)
self.connection = sdk.Connection(
url=self.get_option('ovirt_url'),
username=self.get_option('ovirt_username'),
password=self.get_option('ovirt_password'),
ca_file=self.get_option('ovirt_cafile'),
insecure=self.get_option('ovirt_insecure') if self.get_option('ovirt_insecure') is not None else not self.get_option('ovirt_cafile'),
)
query_filter = self._get_query_options(self.get_option('ovirt_query_filter', None))
cache_key = self.get_cache_key(path)
source_data = None
user_cache_setting = self.get_option('cache')
attempt_to_read_cache = user_cache_setting and cache
cache_needs_update = user_cache_setting and not cache
if attempt_to_read_cache:
try:
source_data = self._cache[cache_key]
except KeyError:
cache_needs_update = True
if source_data is None:
source_data = self._query(query_filter=query_filter)
if cache_needs_update:
self._cache[cache_key] = source_data
self._populate_from_source(source_data)
self.connection.close()

View File

@@ -0,0 +1,209 @@
# -*- coding: utf-8 -*-
#
# (c) 2016 Allen Sanabria, <asanabria@linuxdynasty.org>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
"""
This module adds shared support for generic cloud modules
In order to use this module, include it as part of a custom
module as shown below.
from ansible.module_utils.cloud import CloudRetry
The 'cloud' module provides the following common classes:
* CloudRetry
- The base class to be used by other cloud providers, in order to
provide a backoff/retry decorator based on status codes.
- Example using the AWSRetry class which inherits from CloudRetry.
@AWSRetry.exponential_backoff(retries=10, delay=3)
get_ec2_security_group_ids_from_names()
@AWSRetry.jittered_backoff()
get_ec2_security_group_ids_from_names()
"""
import random
from functools import wraps
import syslog
import time
def _exponential_backoff(retries=10, delay=2, backoff=2, max_delay=60):
""" Customizable exponential backoff strategy.
Args:
retries (int): Maximum number of times to retry a request.
delay (float): Initial (base) delay.
backoff (float): base of the exponent to use for exponential
backoff.
max_delay (int): Optional. If provided each delay generated is capped
at this amount. Defaults to 60 seconds.
Returns:
Callable that returns a generator. This generator yields durations in
seconds to be used as delays for an exponential backoff strategy.
Usage:
>>> backoff = _exponential_backoff()
>>> backoff
<function backoff_backoff at 0x7f0d939facf8>
>>> list(backoff())
[2, 4, 8, 16, 32, 60, 60, 60, 60, 60]
"""
def backoff_gen():
for retry in range(0, retries):
sleep = delay * backoff ** retry
yield sleep if max_delay is None else min(sleep, max_delay)
return backoff_gen
def _full_jitter_backoff(retries=10, delay=3, max_delay=60, _random=random):
""" Implements the "Full Jitter" backoff strategy described here
https://www.awsarchitectureblog.com/2015/03/backoff.html
Args:
retries (int): Maximum number of times to retry a request.
delay (float): Approximate number of seconds to sleep for the first
retry.
max_delay (int): The maximum number of seconds to sleep for any retry.
_random (random.Random or None): Makes this generator testable by
allowing developers to explicitly pass in the a seeded Random.
Returns:
Callable that returns a generator. This generator yields durations in
seconds to be used as delays for a full jitter backoff strategy.
Usage:
>>> backoff = _full_jitter_backoff(retries=5)
>>> backoff
<function backoff_backoff at 0x7f0d939facf8>
>>> list(backoff())
[3, 6, 5, 23, 38]
>>> list(backoff())
[2, 1, 6, 6, 31]
"""
def backoff_gen():
for retry in range(0, retries):
yield _random.randint(0, min(max_delay, delay * 2 ** retry))
return backoff_gen
class CloudRetry(object):
""" CloudRetry can be used by any cloud provider, in order to implement a
backoff algorithm/retry effect based on Status Code from Exceptions.
"""
# This is the base class of the exception.
# AWS Example botocore.exceptions.ClientError
base_class = None
@staticmethod
def status_code_from_exception(error):
""" Return the status code from the exception object
Args:
error (object): The exception itself.
"""
pass
@staticmethod
def found(response_code, catch_extra_error_codes=None):
""" Return True if the Response Code to retry on was found.
Args:
response_code (str): This is the Response Code that is being matched against.
"""
pass
@classmethod
def _backoff(cls, backoff_strategy, catch_extra_error_codes=None):
""" Retry calling the Cloud decorated function using the provided
backoff strategy.
Args:
backoff_strategy (callable): Callable that returns a generator. The
generator should yield sleep times for each retry of the decorated
function.
"""
def deco(f):
@wraps(f)
def retry_func(*args, **kwargs):
for delay in backoff_strategy():
try:
return f(*args, **kwargs)
except Exception as e:
if isinstance(e, cls.base_class):
response_code = cls.status_code_from_exception(e)
if cls.found(response_code, catch_extra_error_codes):
msg = "{0}: Retrying in {1} seconds...".format(str(e), delay)
syslog.syslog(syslog.LOG_INFO, msg)
time.sleep(delay)
else:
# Return original exception if exception is not a ClientError
raise e
else:
# Return original exception if exception is not a ClientError
raise e
return f(*args, **kwargs)
return retry_func # true decorator
return deco
@classmethod
def exponential_backoff(cls, retries=10, delay=3, backoff=2, max_delay=60, catch_extra_error_codes=None):
"""
Retry calling the Cloud decorated function using an exponential backoff.
Kwargs:
retries (int): Number of times to retry a failed request before giving up
default=10
delay (int or float): Initial delay between retries in seconds
default=3
backoff (int or float): backoff multiplier e.g. value of 2 will
double the delay each retry
default=1.1
max_delay (int or None): maximum amount of time to wait between retries.
default=60
"""
return cls._backoff(_exponential_backoff(
retries=retries, delay=delay, backoff=backoff, max_delay=max_delay), catch_extra_error_codes)
@classmethod
def jittered_backoff(cls, retries=10, delay=3, max_delay=60, catch_extra_error_codes=None):
"""
Retry calling the Cloud decorated function using a jittered backoff
strategy. More on this strategy here:
https://www.awsarchitectureblog.com/2015/03/backoff.html
Kwargs:
retries (int): Number of times to retry a failed request before giving up
default=10
delay (int): Initial delay between retries in seconds
default=3
max_delay (int): maximum amount of time to wait between retries.
default=60
"""
return cls._backoff(_full_jitter_backoff(
retries=retries, delay=delay, max_delay=max_delay), catch_extra_error_codes)
@classmethod
def backoff(cls, tries=10, delay=3, backoff=1.1, catch_extra_error_codes=None):
"""
Retry calling the Cloud decorated function using an exponential backoff.
Compatibility for the original implementation of CloudRetry.backoff that
did not provide configurable backoff strategies. Developers should use
CloudRetry.exponential_backoff instead.
Kwargs:
tries (int): Number of times to try (not retry) before giving up
default=10
delay (int or float): Initial delay between retries in seconds
default=3
backoff (int or float): backoff multiplier e.g. value of 2 will
double the delay each retry
default=1.1
"""
return cls.exponential_backoff(
retries=tries - 1, delay=delay, backoff=backoff, max_delay=None, catch_extra_error_codes=catch_extra_error_codes)

View File

@@ -0,0 +1,919 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import inspect
import os
import time
from abc import ABCMeta, abstractmethod
from datetime import datetime
from ansible_collections.ovirt.ovirt.plugins.module_utils.cloud import CloudRetry
from ansible_collections.ovirt.ovirt.plugins.module_utils.version import ComparableVersion
from ansible.module_utils.basic import env_fallback
from ansible.module_utils.common._collections_compat import Mapping
try:
from enum import Enum # enum is a ovirtsdk4 requirement
import ovirtsdk4 as sdk
import ovirtsdk4.version as sdk_version
import ovirtsdk4.types as otypes
HAS_SDK = ComparableVersion(sdk_version.VERSION) >= ComparableVersion('4.4.0')
except ImportError:
HAS_SDK = False
BYTES_MAP = {
'kib': 2**10,
'mib': 2**20,
'gib': 2**30,
'tib': 2**40,
'pib': 2**50,
}
def check_sdk(module):
if not HAS_SDK:
module.fail_json(
msg='ovirtsdk4 version 4.4.0 or higher is required for this module'
)
def remove_underscore(val):
if val.startswith('_'):
val = val[1:]
remove_underscore(val)
return val
def get_dict_of_struct_follow(struct, filter_keys):
if isinstance(struct, sdk.Struct):
res = {}
for key, value in struct.__dict__.items():
if value is None:
continue
key = remove_underscore(key)
if filter_keys is None or key in filter_keys:
res[key] = get_dict_of_struct_follow(value, filter_keys)
return res
elif isinstance(struct, Enum) or isinstance(struct, datetime):
return str(struct)
elif isinstance(struct, list) or isinstance(struct, sdk.List):
return [get_dict_of_struct_follow(i, filter_keys) for i in struct]
return struct
def get_dict_of_struct(struct, connection=None, fetch_nested=False, attributes=None, filter_keys=None, follow=None):
"""
Convert SDK Struct type into dictionary.
"""
if follow:
return get_dict_of_struct_follow(struct, filter_keys)
res = {}
def resolve_href(value):
# Fetch nested values of struct:
try:
value = connection.follow_link(value)
except sdk.Error:
value = None
nested_obj = dict(
(attr, convert_value(getattr(value, attr)))
for attr in attributes if getattr(value, attr, None) is not None
)
nested_obj['id'] = getattr(value, 'id', None)
nested_obj['href'] = getattr(value, 'href', None)
return nested_obj
def convert_value(value):
nested = False
if isinstance(value, sdk.Struct):
if not fetch_nested or not value.href:
return get_dict_of_struct(value)
return resolve_href(value)
elif isinstance(value, Enum) or isinstance(value, datetime):
return str(value)
elif isinstance(value, list) or isinstance(value, sdk.List):
if isinstance(value, sdk.List) and fetch_nested and value.href:
try:
value = connection.follow_link(value)
nested = True
except sdk.Error:
value = []
ret = []
for i in value:
if isinstance(i, sdk.Struct):
if not nested and fetch_nested and i.href:
ret.append(resolve_href(i))
elif not nested:
ret.append(get_dict_of_struct(i))
else:
nested_obj = dict(
(attr, convert_value(getattr(i, attr)))
for attr in attributes if getattr(i, attr, None)
)
nested_obj['id'] = getattr(i, 'id', None)
ret.append(nested_obj)
elif isinstance(i, Enum):
ret.append(str(i))
else:
ret.append(i)
return ret
else:
return value
if struct is not None:
for key, value in struct.__dict__.items():
if value is None:
continue
key = remove_underscore(key)
if filter_keys is None:
res[key] = convert_value(value)
elif key in filter_keys:
res[key] = convert_value(value)
return res
def engine_version(connection):
"""
Return string representation of oVirt engine version.
"""
engine_api = connection.system_service().get()
engine_version = engine_api.product_info.version
return '%s.%s' % (engine_version.major, engine_version.minor)
def create_connection(auth):
"""
Create a connection to Python SDK, from task `auth` parameter.
If user doesnt't have SSO token the `auth` dictionary has following parameters mandatory:
url, username, password
If user has SSO token the `auth` dictionary has following parameters mandatory:
url, token
The `ca_file` parameter is mandatory in case user want to use secure connection,
in case user want to use insecure connection, it's mandatory to send insecure=True.
:param auth: dictionary which contains needed values for connection creation
:return: Python SDK connection
"""
url = auth.get('url')
if url is None and auth.get('hostname') is not None:
url = 'https://{0}/ovirt-engine/api'.format(auth.get('hostname'))
return sdk.Connection(
url=url,
username=auth.get('username'),
password=auth.get('password'),
ca_file=auth.get('ca_file', None),
insecure=auth.get('insecure', False),
token=auth.get('token', None),
kerberos=auth.get('kerberos', None),
headers=auth.get('headers', None),
)
def convert_to_bytes(param):
"""
This method convert units to bytes, which follow IEC standard.
:param param: value to be converted
"""
if param is None:
return None
# Get rid of whitespaces:
param = ''.join(param.split())
# Convert to bytes:
if len(param) > 3 and param[-3].lower() in ['k', 'm', 'g', 't', 'p']:
return int(param[:-3]) * BYTES_MAP.get(param[-3:].lower(), 1)
elif param.isdigit():
return int(param) * 2**10
else:
raise ValueError(
"Unsupported value(IEC supported): '{value}'".format(value=param)
)
def follow_link(connection, link):
"""
This method returns the entity of the element which link points to.
:param connection: connection to the Python SDK
:param link: link of the entity
:return: entity which link points to
"""
if link:
return connection.follow_link(link)
else:
return None
def get_link_name(connection, link):
"""
This method returns the name of the element which link points to.
:param connection: connection to the Python SDK
:param link: link of the entity
:return: name of the entity, which link points to
"""
if link:
return connection.follow_link(link).name
else:
return None
def equal(param1, param2, ignore_case=False):
"""
Compare two parameters and return if they are equal.
This parameter doesn't run equal operation if first parameter is None.
With this approach we don't run equal operation in case user don't
specify parameter in their task.
:param param1: user inputted parameter
:param param2: value of entity parameter
:return: True if parameters are equal or first parameter is None, otherwise False
"""
if param1 is not None:
if ignore_case:
return param1.lower() == param2.lower()
return param1 == param2
return True
def search_by_attributes(service, list_params=None, **kwargs):
"""
Search for the entity by attributes. Nested entities don't support search
via REST, so in case using search for nested entity we return all entities
and filter them by specified attributes.
"""
list_params = list_params or {}
# Check if 'list' method support search(look for search parameter):
if 'search' in inspect.getargspec(service.list)[0]:
res = service.list(
# There must be double quotes around name, because some oVirt resources it's possible to create then with space in name.
search=' and '.join('{0}="{1}"'.format(k, v) for k, v in kwargs.items()),
**list_params
)
else:
res = [
e for e in service.list(**list_params) if len([
k for k, v in kwargs.items() if getattr(e, k, None) == v
]) == len(kwargs)
]
res = res or [None]
return res[0]
def search_by_name(service, name, **kwargs):
"""
Search for the entity by its name. Nested entities don't support search
via REST, so in case using search for nested entity we return all entities
and filter them by name.
:param service: service of the entity
:param name: name of the entity
:return: Entity object returned by Python SDK
"""
# Check if 'list' method support search(look for search parameter):
if 'search' in inspect.getargspec(service.list)[0]:
res = service.list(
# There must be double quotes around name, because some oVirt resources it's possible to create then with space in name.
search='name="{name}"'.format(name=name)
)
else:
res = [e for e in service.list() if e.name == name]
if kwargs:
res = [
e for e in service.list() if len([
k for k, v in kwargs.items() if getattr(e, k, None) == v
]) == len(kwargs)
]
res = res or [None]
return res[0]
def get_entity(service, get_params=None):
"""
Ignore SDK Error in case of getting an entity from service.
"""
entity = None
try:
if get_params is not None:
entity = service.get(**get_params)
else:
entity = service.get()
except sdk.Error:
# We can get here 404, we should ignore it, in case
# of removing entity for example.
pass
return entity
def get_id_by_name(service, name, raise_error=True, ignore_case=False):
"""
Search an entity ID by it's name.
"""
entity = search_by_name(service, name)
if entity is not None:
return entity.id
if raise_error:
raise Exception("Entity '%s' was not found." % name)
def wait(
service,
condition,
fail_condition=lambda e: False,
timeout=180,
wait=True,
poll_interval=3,
):
"""
Wait until entity fulfill expected condition.
:param service: service of the entity
:param condition: condition to be fulfilled
:param fail_condition: if this condition is true, raise Exception
:param timeout: max time to wait in seconds
:param wait: if True wait for condition, if False don't wait
:param poll_interval: Number of seconds we should wait until next condition check
"""
# Wait until the desired state of the entity:
if wait:
start = time.time()
while time.time() < start + timeout:
# Exit if the condition of entity is valid:
entity = get_entity(service)
if condition(entity):
return
elif fail_condition(entity):
raise Exception("Error while waiting on result state of the entity.")
# Sleep for `poll_interval` seconds if none of the conditions apply:
time.sleep(float(poll_interval))
raise Exception("Timeout exceed while waiting on result state of the entity.")
def __get_auth_dict():
return dict(
type='dict',
apply_defaults=True,
required=True,
required_one_of=[['hostname', 'url']],
options=dict(
url=dict(
type='str',
fallback=(env_fallback, ['OVIRT_URL']),
),
hostname=dict(
type='str',
fallback=(env_fallback, ['OVIRT_HOSTNAME']),
),
username=dict(
type='str',
fallback=(env_fallback, ['OVIRT_USERNAME']),
),
password=dict(
type='str',
fallback=(env_fallback, ['OVIRT_PASSWORD']),
no_log=True,
),
insecure=dict(
type='bool',
default=False,
),
token=dict(
type='str',
fallback=(env_fallback, ['OVIRT_TOKEN']),
no_log=False,
),
ca_file=dict(
type='str',
fallback=(env_fallback, ['OVIRT_CAFILE']),
),
compress=dict(
type='bool',
default=True
),
timeout=dict(
type='int',
default=0
),
kerberos=dict(type='bool'),
headers=dict(type='dict')
)
)
def ovirt_info_full_argument_spec(**kwargs):
"""
Extend parameters of info module with parameters which are common to all
oVirt info modules.
:param kwargs: kwargs to be extended
:return: extended dictionary with common parameters
"""
spec = dict(
auth=__get_auth_dict(),
fetch_nested=dict(default=False, type='bool'),
nested_attributes=dict(type='list', default=list(), elements='str'),
follow=dict(default=list(), type='list', elements='str', aliases=['follows']),
)
spec.update(kwargs)
return spec
# Left for third-party module compatibility
def ovirt_facts_full_argument_spec(**kwargs):
"""
This is deprecated. Please use ovirt_info_full_argument_spec instead!
:param kwargs: kwargs to be extended
:return: extended dictionary with common parameters
"""
return ovirt_info_full_argument_spec(**kwargs)
def ovirt_full_argument_spec(**kwargs):
"""
Extend parameters of module with parameters which are common to all oVirt modules.
:param kwargs: kwargs to be extended
:return: extended dictionary with common parameters
"""
spec = dict(
auth=__get_auth_dict(),
timeout=dict(default=180, type='int'),
wait=dict(default=True, type='bool'),
poll_interval=dict(default=3, type='int'),
fetch_nested=dict(default=False, type='bool'),
nested_attributes=dict(type='list', default=list(), elements='str'),
)
spec.update(kwargs)
return spec
def check_params(module):
"""
Most modules must have either `name` or `id` specified.
"""
if module.params.get('name') is None and module.params.get('id') is None:
module.fail_json(msg='"name" or "id" is required')
def engine_supported(connection, version):
return ComparableVersion(engine_version(connection)) >= ComparableVersion(version)
def check_support(version, connection, module, params):
"""
Check if parameters used by user are supported by oVirt Python SDK
and oVirt engine.
"""
api_version = ComparableVersion(engine_version(connection))
version = ComparableVersion(version)
for param in params:
if module.params.get(param) is not None:
return ComparableVersion(sdk_version.VERSION) >= version and api_version >= version
return True
class BaseModule(object):
"""
This is base class for oVirt modules. oVirt modules should inherit this
class and override method to customize specific needs of the module.
The only abstract method of this class is `build_entity`, which must
to be implemented in child class.
"""
__metaclass__ = ABCMeta
def __init__(self, connection, module, service, changed=False):
self._connection = connection
self._module = module
self._service = service
self._changed = changed
self._diff = {'after': dict(), 'before': dict()}
@property
def changed(self):
return self._changed
@changed.setter
def changed(self, changed):
if not self._changed:
self._changed = changed
@abstractmethod
def build_entity(self):
"""
This method should return oVirt Python SDK type, which we want to
create or update, initialized by values passed by Ansible module.
For example if we want to create VM, we will return following:
types.Vm(name=self._module.params['vm_name'])
:return: Specific instance of sdk.Struct.
"""
pass
def param(self, name, default=None):
"""
Return a module parameter specified by it's name.
"""
return self._module.params.get(name, default)
def update_check(self, entity):
"""
This method handle checks whether the entity values are same as values
passed to ansible module. By default we don't compare any values.
:param entity: Entity we want to compare with Ansible module values.
:return: True if values are same, so we don't need to update the entity.
"""
return True
def pre_create(self, entity):
"""
This method is called right before entity is created.
:param entity: Entity to be created or updated.
"""
pass
def post_create(self, entity):
"""
This method is called right after entity is created.
:param entity: Entity which was created.
"""
pass
def post_update(self, entity):
"""
This method is called right after entity is updated.
:param entity: Entity which was updated.
"""
pass
def diff_update(self, after, update):
for k, v in update.items():
if isinstance(v, Mapping):
after[k] = self.diff_update(after.get(k, dict()), v)
else:
after[k] = update[k]
return after
def create(
self,
entity=None,
result_state=None,
fail_condition=lambda e: False,
search_params=None,
update_params=None,
_wait=None,
force_create=False,
**kwargs
):
"""
Method which is called when state of the entity is 'present'. If user
don't provide `entity` parameter the entity is searched using
`search_params` parameter. If entity is found it's updated, whether
the entity should be updated is checked by `update_check` method.
The corresponding updated entity is build by `build_entity` method.
Function executed after entity is created can optionally be specified
in `post_create` parameter. Function executed after entity is updated
can optionally be specified in `post_update` parameter.
:param entity: Entity we want to update, if exists.
:param result_state: State which should entity has in order to finish task.
:param fail_condition: Function which checks incorrect state of entity, if it returns `True` Exception is raised.
:param search_params: Dictionary of parameters to be used for search.
:param update_params: The params which should be passed to update method.
:param kwargs: Additional parameters passed when creating entity.
:return: Dictionary with values returned by Ansible module.
"""
if entity is None and not force_create:
entity = self.search_entity(search_params)
self.pre_create(entity)
if entity:
# Entity exists, so update it:
entity_service = self._service.service(entity.id)
if not self.update_check(entity):
new_entity = self.build_entity()
if not self._module.check_mode:
update_params = update_params or {}
updated_entity = entity_service.update(
new_entity,
**update_params
)
self.post_update(entity)
# Update diffs only if user specified --diff parameter,
# so we don't useless overload API:
if self._module._diff:
before = get_dict_of_struct(
entity,
self._connection,
fetch_nested=True,
attributes=['name'],
)
after = before.copy()
self.diff_update(after, get_dict_of_struct(new_entity))
self._diff['before'] = before
self._diff['after'] = after
self.changed = True
else:
# Entity don't exists, so create it:
if not self._module.check_mode:
entity = self._service.add(
self.build_entity(),
**kwargs
)
self.post_create(entity)
self.changed = True
if not self._module.check_mode:
# Wait for the entity to be created and to be in the defined state:
entity_service = self._service.service(entity.id)
def state_condition(entity):
return entity
if result_state:
def state_condition(entity):
return entity and entity.status == result_state
wait(
service=entity_service,
condition=state_condition,
fail_condition=fail_condition,
wait=_wait if _wait is not None else self._module.params['wait'],
timeout=self._module.params['timeout'],
poll_interval=self._module.params['poll_interval'],
)
return {
'changed': self.changed,
'id': getattr(entity, 'id', None),
type(entity).__name__.lower(): get_dict_of_struct(
struct=entity,
connection=self._connection,
fetch_nested=self._module.params.get('fetch_nested'),
attributes=self._module.params.get('nested_attributes'),
),
'diff': self._diff,
}
def pre_remove(self, entity):
"""
This method is called right before entity is removed.
:param entity: Entity which we want to remove.
"""
pass
def entity_name(self, entity):
return "{e_type} '{e_name}'".format(
e_type=type(entity).__name__.lower(),
e_name=getattr(entity, 'name', None),
)
def remove(self, entity=None, search_params=None, **kwargs):
"""
Method which is called when state of the entity is 'absent'. If user
don't provide `entity` parameter the entity is searched using
`search_params` parameter. If entity is found it's removed.
Function executed before remove is executed can optionally be specified
in `pre_remove` parameter.
:param entity: Entity we want to remove.
:param search_params: Dictionary of parameters to be used for search.
:param kwargs: Additional parameters passed when removing entity.
:return: Dictionary with values returned by Ansible module.
"""
if entity is None:
entity = self.search_entity(search_params)
if entity is None:
return {
'changed': self.changed,
'msg': "Entity wasn't found."
}
self.pre_remove(entity)
entity_service = self._service.service(entity.id)
if not self._module.check_mode:
entity_service.remove(**kwargs)
wait(
service=entity_service,
condition=lambda entity: not entity,
wait=self._module.params['wait'],
timeout=self._module.params['timeout'],
poll_interval=self._module.params['poll_interval'],
)
self.changed = True
return {
'changed': self.changed,
'id': entity.id,
type(entity).__name__.lower(): get_dict_of_struct(
struct=entity,
connection=self._connection,
fetch_nested=self._module.params.get('fetch_nested'),
attributes=self._module.params.get('nested_attributes'),
),
}
def action(
self,
action,
entity=None,
action_condition=lambda e: e,
wait_condition=lambda e: e,
fail_condition=lambda e: False,
pre_action=lambda e: e,
post_action=lambda e: None,
search_params=None,
**kwargs
):
"""
This method is executed when we want to change the state of some oVirt
entity. The action to be executed on oVirt service is specified by
`action` parameter. Whether the action should be executed can be
specified by passing `action_condition` parameter. State which the
entity should be in after execution of the action can be specified
by `wait_condition` parameter.
Function executed before an action on entity can optionally be specified
in `pre_action` parameter. Function executed after an action on entity can
optionally be specified in `post_action` parameter.
:param action: Action which should be executed by service on entity.
:param entity: Entity we want to run action on.
:param action_condition: Function which is executed when checking if action should be executed.
:param fail_condition: Function which checks incorrect state of entity, if it returns `True` Exception is raised.
:param wait_condition: Function which is executed when waiting on result state.
:param pre_action: Function which is executed before running the action.
:param post_action: Function which is executed after running the action.
:param search_params: Dictionary of parameters to be used for search.
:param kwargs: Additional parameters passed to action.
:return: Dictionary with values returned by Ansible module.
"""
if entity is None:
entity = self.search_entity(search_params)
entity = pre_action(entity)
if entity is None:
self._module.fail_json(
msg="Entity not found, can't run action '{0}'.".format(
action
)
)
entity_service = self._service.service(entity.id)
entity = entity_service.get()
if action_condition(entity):
if not self._module.check_mode:
getattr(entity_service, action)(**kwargs)
self.changed = True
post_action(entity)
wait(
service=self._service.service(entity.id),
condition=wait_condition,
fail_condition=fail_condition,
wait=self._module.params['wait'],
timeout=self._module.params['timeout'],
poll_interval=self._module.params['poll_interval'],
)
return {
'changed': self.changed,
'id': entity.id,
type(entity).__name__.lower(): get_dict_of_struct(
struct=entity,
connection=self._connection,
fetch_nested=self._module.params.get('fetch_nested'),
attributes=self._module.params.get('nested_attributes'),
),
'diff': self._diff,
}
def wait_for_import(self, condition=lambda e: True):
if self._module.params['wait']:
start = time.time()
timeout = self._module.params['timeout']
poll_interval = self._module.params['poll_interval']
while time.time() < start + timeout:
entity = self.search_entity()
if entity and condition(entity):
return entity
time.sleep(poll_interval)
def search_entity(self, search_params=None, list_params=None):
"""
Always first try to search by `ID`, if ID isn't specified,
check if user constructed special search in `search_params`,
if not search by `name`.
"""
entity = None
if 'id' in self._module.params and self._module.params['id'] is not None:
entity = get_entity(self._service.service(self._module.params['id']), get_params=list_params)
elif search_params is not None:
entity = search_by_attributes(self._service, list_params=list_params, **search_params)
elif self._module.params.get('name') is not None:
entity = search_by_attributes(self._service, list_params=list_params, name=self._module.params['name'])
return entity
def _get_major(self, full_version):
if full_version is None or full_version == "":
return None
if isinstance(full_version, otypes.Version):
return int(full_version.major)
return int(full_version.split('.')[0])
def _get_minor(self, full_version):
if full_version is None or full_version == "":
return None
if isinstance(full_version, otypes.Version):
return int(full_version.minor)
return int(full_version.split('.')[1])
def _sdk4_error_maybe():
"""
Allow for ovirtsdk4 not being installed.
"""
if HAS_SDK:
return sdk.Error
return type(None)
class OvirtRetry(CloudRetry):
base_class = _sdk4_error_maybe()
@staticmethod
def status_code_from_exception(error):
return error.code
@staticmethod
def found(response_code, catch_extra_error_codes=None):
# This is a list of error codes to retry.
retry_on = [
# HTTP status: Conflict
409,
]
if catch_extra_error_codes:
retry_on.extend(catch_extra_error_codes)
return response_code in retry_on

View File

@@ -0,0 +1,52 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
class ComparableVersion:
component_re = re.compile(r'(\d+ | [a-z]+ | \.)', re.VERBOSE)
def __init__(self, vstring=None):
if vstring:
self.parse(vstring)
def __eq__(self, other):
return self._cmp(other) == 0
def __lt__(self, other):
return self._cmp(other) < 0
def __le__(self, other):
return self._cmp(other) <= 0
def __gt__(self, other):
return self._cmp(other) > 0
def __ge__(self, other):
return self._cmp(other) >= 0
def parse(self, vstring):
self.vstring = vstring
components = [x for x in self.component_re.split(vstring)
if x and x != '.']
for i, obj in enumerate(components):
try:
components[i] = int(obj)
except ValueError:
pass
self.version = components
def _cmp(self, other):
if isinstance(other, str):
other = ComparableVersion(other)
elif not isinstance(other, ComparableVersion):
return NotImplemented
if self.version == other.version:
return 0
if self.version < other.version:
return -1
if self.version > other.version:
return 1

Some files were not shown because too many files have changed in this diff Show More