diff --git a/.github/BOTMETA.yml b/.github/BOTMETA.yml
index f609289580..144eca81a7 100644
--- a/.github/BOTMETA.yml
+++ b/.github/BOTMETA.yml
@@ -186,8 +186,6 @@ files:
maintainers: glitchcrab
$modules/cloud/misc/cloud_init_data_facts.py:
maintainers: resmo
- $modules/cloud/misc/helm.py:
- maintainers: flaper87
$modules/cloud/misc/proxmox.py:
maintainers: $team_virt UnderGreen
labels: proxmox virt
@@ -348,8 +346,6 @@ files:
maintainers: dagwieers magnus919 tbielawa cmprescott sm4rk0
labels: m:xml xml
ignore: magnus919
- $modules/identity/onepassword_facts.py:
- maintainers: Rylon
$modules/identity/ipa/:
maintainers: $team_ipa
$modules/identity/ipa/ipa_pwpolicy.py:
@@ -452,8 +448,6 @@ files:
maintainers: akostyuk
$modules/net_tools/ipwcli_dns.py:
maintainers: cwollinger
- $modules/net_tools/ldap/ldap_attr.py:
- maintainers: jtyr
$modules/net_tools/ldap/ldap_attrs.py:
maintainers: drybjed jtyr noles
$modules/net_tools/ldap/ldap_entry.py:
@@ -718,8 +712,6 @@ files:
maintainers: evertmulder
$modules/remote_management/manageiq/manageiq_tenant.py:
maintainers: evertmulder
- $modules/remote_management/oneview/oneview_datacenter_facts.py:
- maintainers: aalexmonteiro madhav-bharadwaj ricardogpsf soodpr
$modules/remote_management/oneview/:
maintainers: adriane-cardozo fgbulsoni tmiotto
$modules/remote_management/oneview/oneview_datacenter_info.py:
@@ -766,12 +758,6 @@ files:
maintainers: yeukhon
$modules/storage/emc/emc_vnx_sg_member.py:
maintainers: remixtj
- $modules/storage/glusterfs/:
- maintainers: devyanikota
- $modules/storage/glusterfs/gluster_peer.py:
- maintainers: sac
- $modules/storage/glusterfs/gluster_volume.py:
- maintainers: rosmo
$modules/storage/hpe3par/ss_3par_cpg.py:
maintainers: farhan7500 gautamphegde
$modules/storage/ibm/:
@@ -793,9 +779,6 @@ files:
maintainers: johanwiren
$modules/storage/zfs/zfs_delegate_admin.py:
maintainers: natefoo
- $modules/system/python_requirements_facts.py:
- maintainers: willthames
- ignore: ryansb
$modules/system/aix:
maintainers: $team_aix
labels: aix
@@ -926,10 +909,6 @@ files:
labels: xfconf
$modules/system/xfs_quota.py:
maintainers: bushvin
- $modules/web_infrastructure/jenkins_job_facts.py:
- maintainers: stpierre
- $modules/web_infrastructure/nginx_status_facts.py:
- maintainers: resmo
$modules/web_infrastructure/apache2_mod_proxy.py:
maintainers: oboukili
$modules/web_infrastructure/apache2_module.py:
diff --git a/changelogs/fragments/remove-deprecated-modules.yml b/changelogs/fragments/remove-deprecated-modules.yml
new file mode 100644
index 0000000000..fa9d9c9eb7
--- /dev/null
+++ b/changelogs/fragments/remove-deprecated-modules.yml
@@ -0,0 +1,66 @@
+removed_features:
+- "The deprecated ali_instance_facts module has been removed. Use ali_instance_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated hpilo_facts module has been removed. Use hpilo_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated idrac_redfish_facts module has been removed. Use idrac_redfish_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated jenkins_job_facts module has been removed. Use jenkins_job_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated memset_memstore_facts module has been removed. Use memset_memstore_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated memset_server_facts module has been removed. Use memset_server_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated na_ontap_gather_facts module has been removed. Use netapp.ontap.na_ontap_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated nginx_status_facts module has been removed. Use nginx_status_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated one_image_facts module has been removed. Use one_image_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated onepassword_facts module has been removed. Use onepassword_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated oneview_datacenter_facts module has been removed. Use oneview_datacenter_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated oneview_enclosure_facts module has been removed. Use oneview_enclosure_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated oneview_ethernet_network_facts module has been removed. Use oneview_ethernet_network_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated oneview_fc_network_facts module has been removed. Use oneview_fc_network_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated oneview_fcoe_network_facts module has been removed. Use oneview_fcoe_network_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated oneview_logical_interconnect_group_facts module has been removed. Use oneview_logical_interconnect_group_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated oneview_network_set_facts module has been removed. Use oneview_network_set_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated oneview_san_manager_facts module has been removed. Use oneview_san_manager_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated online_server_facts module has been removed. Use online_server_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated online_user_facts module has been removed. Use online_user_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated purefa_facts module has been removed. Use purestorage.flasharray.purefa_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated purefb_facts module has been removed. Use purestorage.flasharray.purefb_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated python_requirements_facts module has been removed. Use python_requirements_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated redfish_facts module has been removed. Use redfish_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated scaleway_image_facts module has been removed. Use scaleway_image_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated scaleway_ip_facts module has been removed. Use scaleway_ip_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated scaleway_organization_facts module has been removed. Use scaleway_organization_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated scaleway_security_group_facts module has been removed. Use scaleway_security_group_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated scaleway_server_facts module has been removed. Use scaleway_server_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated scaleway_snapshot_facts module has been removed. Use scaleway_snapshot_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated scaleway_volume_facts module has been removed. Use scaleway_volume_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated smartos_image_facts module has been removed. Use smartos_image_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated vertica_facts module has been removed. Use vertica_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated xenserver_guest_facts module has been removed. Use xenserver_guest_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt module has been removed. Use ovirt.ovirt.ovirt_vm instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_affinity_label_facts module has been removed. Use ovirt.ovirt.ovirt_affinity_label_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_api_facts module has been removed. Use ovirt.ovirt.ovirt_api_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_cluster_facts module has been removed. Use ovirt.ovirt.ovirt_cluster_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_datacenter_facts module has been removed. Use ovirt.ovirt.ovirt_datacenter_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_disk_facts module has been removed. Use ovirt.ovirt.ovirt_disk_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_event_facts module has been removed. Use ovirt.ovirt.ovirt_event_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_external_provider_facts module has been removed. Use ovirt.ovirt.ovirt_external_provider_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_group_facts module has been removed. Use ovirt.ovirt.ovirt_group_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_host_facts module has been removed. Use ovirt.ovirt.ovirt_host_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_host_storage_facts module has been removed. Use ovirt.ovirt.ovirt_host_storage_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_network_facts module has been removed. Use ovirt.ovirt.ovirt_network_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_nic_facts module has been removed. Use ovirt.ovirt.ovirt_nic_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_permission_facts module has been removed. Use ovirt.ovirt.ovirt_permission_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_quota_facts module has been removed. Use ovirt.ovirt.ovirt_quota_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_scheduling_policy_facts module has been removed. Use ovirt.ovirt.ovirt_scheduling_policy_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_snapshot_facts module has been removed. Use ovirt.ovirt.ovirt_snapshot_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_storage_domain_facts module has been removed. Use ovirt.ovirt.ovirt_storage_domain_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_storage_template_facts module has been removed. Use ovirt.ovirt.ovirt_storage_template_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_storage_vm_facts module has been removed. Use ovirt.ovirt.ovirt_storage_vm_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_tag_facts module has been removed. Use ovirt.ovirt.ovirt_tag_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_template_facts module has been removed. Use ovirt.ovirt.ovirt_template_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_user_facts module has been removed. Use ovirt.ovirt.ovirt_user_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_vm_facts module has been removed. Use ovirt.ovirt.ovirt_vm_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ovirt_vmpool_facts module has been removed. Use ovirt.ovirt.ovirt_vmpool_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The ovirt_facts docs fragment has been removed (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated gluster_heal_info module has been removed. Use gluster.gluster.gluster_heal_info instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated gluster_peer module has been removed. Use gluster.gluster.gluster_peer instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated gluster_volume module has been removed. Use gluster.gluster.gluster_volume instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated helm module has been removed. Use community.kubernetes.helm instead (https://github.com/ansible-collections/community.general/pull/1924)."
+- "The deprecated ldap_attr module has been removed. Use ldap_attrs instead (https://github.com/ansible-collections/community.general/pull/1924)."
diff --git a/galaxy.yml b/galaxy.yml
index bb1eb75153..3676516625 100644
--- a/galaxy.yml
+++ b/galaxy.yml
@@ -1,6 +1,6 @@
namespace: community
name: general
-version: 2.5.0
+version: 3.0.0
readme: README.md
authors:
- Ansible (https://github.com/ansible)
diff --git a/meta/runtime.yml b/meta/runtime.yml
index 00eed0fa84..c116029974 100644
--- a/meta/runtime.yml
+++ b/meta/runtime.yml
@@ -39,7 +39,7 @@ plugin_routing:
redirect: community.hashi_vault.hashi_vault
modules:
ali_instance_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.ali_instance_info instead.
docker_compose:
@@ -159,8 +159,7 @@ plugin_routing:
gcpubsub_info:
redirect: community.google.gcpubsub_info
gcpubsub_facts:
- redirect: community.google.gcpubsub_info
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.google.gcpubsub_info instead.
gcspanner:
@@ -171,22 +170,23 @@ plugin_routing:
tombstone:
removal_version: 2.0.0
warning_text: Use community.general.github_webhook and community.general.github_webhook_info instead.
- gluster_heal_info:
- deprecation:
- removal_version: 3.0.0
- warning_text: The gluster modules have migrated to the gluster.gluster collection. Use gluster.gluster.gluster_heal_info instead.
- gluster_peer:
- deprecation:
- removal_version: 3.0.0
- warning_text: The gluster modules have migrated to the gluster.gluster collection. Use gluster.gluster.gluster_peer instead.
- gluster_volume:
- deprecation:
- removal_version: 3.0.0
- warning_text: The gluster modules have migrated to the gluster.gluster collection. Use gluster.gluster.gluster_volume instead.
- helm:
- deprecation:
- removal_version: 3.0.0
- warning_text: The helm module in community.general has been deprecated. Use community.kubernetes.helm instead.
+ # Adding tombstones burns the old name, so we simply remove the entries:
+ # gluster_heal_info:
+ # tombstone:
+ # removal_version: 3.0.0
+ # warning_text: The gluster modules have migrated to the gluster.gluster collection. Use gluster.gluster.gluster_heal_info instead.
+ # gluster_peer:
+ # tombstone:
+ # removal_version: 3.0.0
+ # warning_text: The gluster modules have migrated to the gluster.gluster collection. Use gluster.gluster.gluster_peer instead.
+ # gluster_volume:
+ # tombstone:
+ # removal_version: 3.0.0
+ # warning_text: The gluster modules have migrated to the gluster.gluster collection. Use gluster.gluster.gluster_volume instead.
+ # helm:
+ # tombstone:
+ # removal_version: 3.0.0
+ # warning_text: Use community.kubernetes.helm instead.
hetzner_failover_ip:
redirect: community.hrobot.failover_ip
hetzner_failover_ip_info:
@@ -196,19 +196,19 @@ plugin_routing:
hetzner_firewall_info:
redirect: community.hrobot.firewall_info
hpilo_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.hpilo_info instead.
idrac_firmware:
redirect: dellemc.openmanage.idrac_firmware
idrac_redfish_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.idrac_redfish_info instead.
idrac_server_config_profile:
redirect: dellemc.openmanage.idrac_server_config_profile
jenkins_job_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.jenkins_job_info instead.
katello:
@@ -228,7 +228,7 @@ plugin_routing:
kubevirt_vm:
redirect: community.kubevirt.kubevirt_vm
ldap_attr:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.ldap_attrs instead.
logicmonitor:
@@ -240,11 +240,11 @@ plugin_routing:
removal_version: 1.0.0
warning_text: The logicmonitor_facts module is no longer maintained and the API used has been disabled in 2017.
memset_memstore_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.memset_memstore_info instead.
memset_server_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.memset_server_info instead.
na_cdot_aggregate:
@@ -280,161 +280,161 @@ plugin_routing:
removal_version: 2.0.0
warning_text: Use netapp.ontap.na_ontap_volume instead.
na_ontap_gather_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use netapp.ontap.na_ontap_info instead.
nginx_status_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.nginx_status_info instead.
ome_device_info:
redirect: dellemc.openmanage.ome_device_info
one_image_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.one_image_info instead.
onepassword_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.onepassword_info instead.
oneview_datacenter_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.oneview_datacenter_info instead.
oneview_enclosure_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.oneview_enclosure_info instead.
oneview_ethernet_network_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.oneview_ethernet_network_info instead.
oneview_fc_network_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.oneview_fc_network_info instead.
oneview_fcoe_network_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.oneview_fcoe_network_info instead.
oneview_logical_interconnect_group_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.oneview_logical_interconnect_group_info instead.
oneview_network_set_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.oneview_network_set_info instead.
oneview_san_manager_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.oneview_san_manager_info instead.
online_server_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.online_server_info instead.
online_user_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.online_user_info instead.
ovirt:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_vm instead.
ovirt_affinity_label_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_affinity_label_info instead.
ovirt_api_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_api_info instead.
ovirt_cluster_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_cluster_info instead.
ovirt_datacenter_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_datacenter_info instead.
ovirt_disk_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_disk_info instead.
ovirt_event_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_event_info instead.
ovirt_external_provider_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_external_provider_info instead.
ovirt_group_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_group_info instead.
ovirt_host_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_host_info instead.
ovirt_host_storage_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_host_storage_info instead.
ovirt_network_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_network_info instead.
ovirt_nic_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_nic_info instead.
ovirt_permission_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_permission_info instead.
ovirt_quota_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_quota_info instead.
ovirt_scheduling_policy_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_scheduling_policy_info instead.
ovirt_snapshot_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_snapshot_info instead.
ovirt_storage_domain_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_storage_domain_info instead.
ovirt_storage_template_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_storage_template_info instead.
ovirt_storage_vm_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_storage_vm_info instead.
ovirt_tag_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_tag_info instead.
ovirt_template_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_template_info instead.
ovirt_user_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_user_info instead.
ovirt_vm_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_vm_info instead.
ovirt_vmpool_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use ovirt.ovirt.ovirt_vmpool_info instead.
postgresql_copy:
@@ -482,47 +482,47 @@ plugin_routing:
postgresql_user:
redirect: community.postgresql.postgresql_user
purefa_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use purestorage.flasharray.purefa_info instead.
purefb_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use purestorage.flashblade.purefb_info instead.
python_requirements_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.python_requirements_info instead.
redfish_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.redfish_info instead.
scaleway_image_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.scaleway_image_info instead.
scaleway_ip_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.scaleway_ip_info instead.
scaleway_organization_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.scaleway_organization_info instead.
scaleway_security_group_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.scaleway_security_group_info instead.
scaleway_server_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.scaleway_server_info instead.
scaleway_snapshot_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.scaleway_snapshot_info instead.
scaleway_volume_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.scaleway_volume_info instead.
sf_account_manager:
@@ -546,15 +546,15 @@ plugin_routing:
removal_version: 2.0.0
warning_text: Use netapp.elementsw.na_elementsw_volume instead.
smartos_image_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.smartos_image_info instead.
vertica_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.vertica_info instead.
xenserver_guest_facts:
- deprecation:
+ tombstone:
removal_version: 3.0.0
warning_text: Use community.general.xenserver_guest_info instead.
doc_fragments:
diff --git a/plugins/doc_fragments/ovirt_facts.py b/plugins/doc_fragments/ovirt_facts.py
deleted file mode 100644
index 43b9b37b0c..0000000000
--- a/plugins/doc_fragments/ovirt_facts.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# -*- 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).
- 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
- auth:
- description:
- - "Dictionary with values needed to create HTTP/HTTPS connection to oVirt:"
- - C(username)[I(required)] - The name of the user, something like I(admin@internal).
- Default value is set by I(OVIRT_USERNAME) environment variable.
- - "C(password)[I(required)] - The password of the user. Default value is set by I(OVIRT_PASSWORD) environment variable."
- - "C(url)- 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 I(OVIRT_URL) environment variable.
- Either C(url) or C(hostname) is required."
- - "C(hostname) - A string containing the hostname of the server, usually
- something like `I(server.example.com)`. Default value is set by I(OVIRT_HOSTNAME) environment variable.
- Either C(url) or C(hostname) is required."
- - "C(token) - Token to be used instead of login with username/password. Default value is set by I(OVIRT_TOKEN) environment variable."
- - "C(insecure) - A boolean flag that indicates if the server TLS
- certificate and host name should be checked."
- - "C(ca_file) - 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 I(OVIRT_CAFILE) environment variable."
- - "C(kerberos) - A boolean flag indicating if Kerberos authentication
- should be used instead of the default basic authentication."
- - "C(headers) - Dictionary of HTTP headers to be added to each API call."
- type: dict
- required: true
-requirements:
- - python >= 2.7
- - ovirt-engine-sdk-python >= 4.3.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:
- ansible.builtin.pip: name=ovirt-engine-sdk-python version=4.3.0"
-'''
diff --git a/plugins/module_utils/_ovirt.py b/plugins/module_utils/_ovirt.py
deleted file mode 100644
index 5ccd1482a0..0000000000
--- a/plugins/module_utils/_ovirt.py
+++ /dev/null
@@ -1,871 +0,0 @@
-# -*- 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 .
-#
-
-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 distutils.version import LooseVersion
-
-from ansible_collections.community.general.plugins.module_utils.cloud import CloudRetry
-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 = LooseVersion(sdk_version.VERSION) >= LooseVersion('4.3.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.3.0 or higher is required for this module'
- )
-
-
-def get_dict_of_struct(struct, connection=None, fetch_nested=False, attributes=None):
- """
- Convert SDK Struct type into dictionary.
- """
- 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 remove_underscore(val):
- if val.startswith('_'):
- val = val[1:]
- remove_underscore(val)
- return val
-
- 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)
- 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():
- OVIRT_URL = os.environ.get('OVIRT_URL')
- OVIRT_HOSTNAME = os.environ.get('OVIRT_HOSTNAME')
- OVIRT_USERNAME = os.environ.get('OVIRT_USERNAME')
- OVIRT_PASSWORD = os.environ.get('OVIRT_PASSWORD')
- OVIRT_TOKEN = os.environ.get('OVIRT_TOKEN')
- OVIRT_CAFILE = os.environ.get('OVIRT_CAFILE')
- OVIRT_INSECURE = OVIRT_CAFILE is None
-
- env_vars = None
- if OVIRT_URL is None and OVIRT_HOSTNAME is not None:
- OVIRT_URL = 'https://{0}/ovirt-engine/api'.format(OVIRT_HOSTNAME)
- if OVIRT_URL and ((OVIRT_USERNAME and OVIRT_PASSWORD) or OVIRT_TOKEN):
- env_vars = {
- 'url': OVIRT_URL,
- 'username': OVIRT_USERNAME,
- 'password': OVIRT_PASSWORD,
- 'insecure': OVIRT_INSECURE,
- 'token': OVIRT_TOKEN,
- 'ca_file': OVIRT_CAFILE,
- }
- if env_vars is not None:
- auth = dict(default=env_vars, type='dict')
- else:
- auth = dict(required=True, type='dict')
-
- return auth
-
-
-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()),
- )
- 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()),
- )
- 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 LooseVersion(engine_version(connection)) >= LooseVersion(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 = LooseVersion(engine_version(connection))
- version = LooseVersion(version)
- for param in params:
- if module.params.get(param) is not None:
- return LooseVersion(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
diff --git a/plugins/modules/ali_instance_facts.py b/plugins/modules/ali_instance_facts.py
deleted file mode 120000
index 7c9f5ebe6e..0000000000
--- a/plugins/modules/ali_instance_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-cloud/alicloud/ali_instance_facts.py
\ No newline at end of file
diff --git a/plugins/modules/cloud/alicloud/ali_instance_facts.py b/plugins/modules/cloud/alicloud/ali_instance_facts.py
deleted file mode 120000
index 5202c55448..0000000000
--- a/plugins/modules/cloud/alicloud/ali_instance_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-ali_instance_info.py
\ No newline at end of file
diff --git a/plugins/modules/cloud/alicloud/ali_instance_info.py b/plugins/modules/cloud/alicloud/ali_instance_info.py
index 33b3f8a6ad..8a3b8aeed0 100644
--- a/plugins/modules/cloud/alicloud/ali_instance_info.py
+++ b/plugins/modules/cloud/alicloud/ali_instance_info.py
@@ -383,9 +383,6 @@ def main():
)
)
module = AnsibleModule(argument_spec=argument_spec)
- if module._name in ('ali_instance_facts', 'community.general.ali_instance_facts'):
- module.deprecate("The 'ali_instance_facts' module has been renamed to 'ali_instance_info'",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
if HAS_FOOTMARK is False:
module.fail_json(msg=missing_required_lib('footmark'), exception=FOOTMARK_IMP_ERR)
diff --git a/plugins/modules/cloud/memset/memset_memstore_facts.py b/plugins/modules/cloud/memset/memset_memstore_facts.py
deleted file mode 120000
index aa78805717..0000000000
--- a/plugins/modules/cloud/memset/memset_memstore_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-memset_memstore_info.py
\ No newline at end of file
diff --git a/plugins/modules/cloud/memset/memset_memstore_info.py b/plugins/modules/cloud/memset/memset_memstore_info.py
index 5eea6ab191..df5ede1a62 100644
--- a/plugins/modules/cloud/memset/memset_memstore_info.py
+++ b/plugins/modules/cloud/memset/memset_memstore_info.py
@@ -151,9 +151,6 @@ def main():
),
supports_check_mode=False
)
- if module._name in ('memset_memstore_facts', 'community.general.memset_memstore_facts'):
- module.deprecate("The 'memset_memstore_facts' module has been renamed to 'memset_memstore_info'",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
# populate the dict with the user-provided vars.
args = dict()
diff --git a/plugins/modules/cloud/memset/memset_server_facts.py b/plugins/modules/cloud/memset/memset_server_facts.py
deleted file mode 120000
index 0a5766aee4..0000000000
--- a/plugins/modules/cloud/memset/memset_server_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-memset_server_info.py
\ No newline at end of file
diff --git a/plugins/modules/cloud/memset/memset_server_info.py b/plugins/modules/cloud/memset/memset_server_info.py
index d8943c1454..50fe39fd99 100644
--- a/plugins/modules/cloud/memset/memset_server_info.py
+++ b/plugins/modules/cloud/memset/memset_server_info.py
@@ -276,9 +276,6 @@ def main():
),
supports_check_mode=False
)
- if module._name in ('memset_server_facts', 'community.general.memset_server_facts'):
- module.deprecate("The 'memset_server_facts' module has been renamed to 'memset_server_info'",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
# populate the dict with the user-provided vars.
args = dict()
diff --git a/plugins/modules/cloud/misc/helm.py b/plugins/modules/cloud/misc/helm.py
deleted file mode 100644
index dd592d6e92..0000000000
--- a/plugins/modules/cloud/misc/helm.py
+++ /dev/null
@@ -1,216 +0,0 @@
-#!/usr/bin/python
-# (c) 2016, Flavio Percoco
-#
-# 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
-
-
-DOCUMENTATION = '''
----
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.14
- why: For more details https://github.com/ansible/ansible/issues/61546.
- alternative: Use M(community.kubernetes.helm) instead.
-module: helm
-short_description: Manages Kubernetes packages with the Helm package manager
-author: "Flavio Percoco (@flaper87)"
-description:
- - Install, upgrade, delete and list packages with the Helm package manager.
-requirements:
- - "pyhelm"
- - "grpcio"
-options:
- host:
- description:
- - Tiller's server host.
- type: str
- default: "localhost"
- port:
- description:
- - Tiller's server port.
- type: int
- default: 44134
- namespace:
- description:
- - Kubernetes namespace where the chart should be installed.
- type: str
- default: "default"
- name:
- description:
- - Release name to manage.
- type: str
- state:
- description:
- - Whether to install C(present), remove C(absent), or purge C(purged) a package.
- choices: ['absent', 'purged', 'present']
- type: str
- default: "present"
- chart:
- description:
- - A map describing the chart to install. See examples for available options.
- type: dict
- default: {}
- values:
- description:
- - A map of value options for the chart.
- type: dict
- default: {}
- disable_hooks:
- description:
- - Whether to disable hooks during the uninstall process.
- type: bool
- default: 'no'
-'''
-
-RETURN = ''' # '''
-
-EXAMPLES = '''
-- name: Install helm chart
- community.general.helm:
- host: localhost
- chart:
- name: memcached
- version: 0.4.0
- source:
- type: repo
- location: https://kubernetes-charts.storage.googleapis.com
- state: present
- name: my-memcached
- namespace: default
-
-- name: Uninstall helm chart
- community.general.helm:
- host: localhost
- state: absent
- name: my-memcached
-
-- name: Install helm chart from a git repo
- community.general.helm:
- host: localhost
- chart:
- source:
- type: git
- location: https://github.com/user/helm-chart.git
- state: present
- name: my-example
- namespace: default
- values:
- foo: "bar"
-
-- name: Install helm chart from a git repo specifying path
- community.general.helm:
- host: localhost
- chart:
- source:
- type: git
- location: https://github.com/helm/charts.git
- path: stable/memcached
- state: present
- name: my-memcached
- namespace: default
- values: "{{ lookup('file', '/path/to/file/values.yaml') | from_yaml }}"
-'''
-
-import traceback
-HELM_IMPORT_ERR = None
-try:
- import grpc
- from pyhelm import tiller
- from pyhelm import chartbuilder
-except ImportError:
- HELM_IMPORT_ERR = traceback.format_exc()
-
-from ansible.module_utils.basic import AnsibleModule, missing_required_lib
-
-
-def install(module, tserver):
- changed = False
- params = module.params
- name = params['name']
- values = params['values']
- chart = module.params['chart']
- namespace = module.params['namespace']
-
- chartb = chartbuilder.ChartBuilder(chart)
- r_matches = (x for x in tserver.list_releases()
- if x.name == name and x.namespace == namespace)
- installed_release = next(r_matches, None)
- if installed_release:
- if installed_release.chart.metadata.version != chart['version']:
- tserver.update_release(chartb.get_helm_chart(), False,
- namespace, name=name, values=values)
- changed = True
- else:
- tserver.install_release(chartb.get_helm_chart(), namespace,
- dry_run=False, name=name,
- values=values)
- changed = True
-
- return dict(changed=changed)
-
-
-def delete(module, tserver, purge=False):
- changed = False
- params = module.params
-
- if not module.params['name']:
- module.fail_json(msg='Missing required field name')
-
- name = module.params['name']
- disable_hooks = params['disable_hooks']
-
- try:
- tserver.uninstall_release(name, disable_hooks, purge)
- changed = True
- except grpc._channel._Rendezvous as exc:
- if 'not found' not in str(exc):
- raise exc
-
- return dict(changed=changed)
-
-
-def main():
- """The main function."""
- module = AnsibleModule(
- argument_spec=dict(
- host=dict(type='str', default='localhost'),
- port=dict(type='int', default=44134),
- name=dict(type='str', default=''),
- chart=dict(type='dict'),
- state=dict(
- choices=['absent', 'purged', 'present'],
- default='present'
- ),
- # Install options
- values=dict(type='dict'),
- namespace=dict(type='str', default='default'),
-
- # Uninstall options
- disable_hooks=dict(type='bool', default=False),
- ),
- supports_check_mode=True)
-
- if HELM_IMPORT_ERR:
- module.fail_json(msg=missing_required_lib('pyhelm'), exception=HELM_IMPORT_ERR)
-
- host = module.params['host']
- port = module.params['port']
- state = module.params['state']
- tserver = tiller.Tiller(host, port)
-
- if state == 'present':
- rst = install(module, tserver)
-
- if state in 'absent':
- rst = delete(module, tserver)
-
- if state in 'purged':
- rst = delete(module, tserver, True)
-
- module.exit_json(**rst)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/misc/ovirt.py b/plugins/modules/cloud/misc/ovirt.py
deleted file mode 100644
index 25e3081c8f..0000000000
--- a/plugins/modules/cloud/misc/ovirt.py
+++ /dev/null
@@ -1,503 +0,0 @@
-#!/usr/bin/python
-
-# Copyright: (c) 2013, Vincent Van der Kussen
-# 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
-
-DOCUMENTATION = '''
----
-module: ovirt
-author:
-- Vincent Van der Kussen (@vincentvdk)
-short_description: oVirt/RHEV platform management
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.14
- why: This module is for deprecated version of ovirt.
- alternative: Use C(ovirt_vm) from the C(ovirt.ovirt) collection instead
-description:
- - This module only supports oVirt/RHEV version 3. A newer module M(ovirt.ovirt.ovirt_vm) supports oVirt/RHV version 4.
- - Allows you to create new instances, either from scratch or an image, in addition to deleting or stopping instances on the oVirt/RHEV platform.
-options:
- user:
- description:
- - The user to authenticate with.
- type: str
- required: true
- url:
- description:
- - The url of the oVirt instance.
- type: str
- required: true
- instance_name:
- description:
- - The name of the instance to use.
- type: str
- required: true
- aliases: [ vmname ]
- password:
- description:
- - Password of the user to authenticate with.
- type: str
- required: true
- image:
- description:
- - The template to use for the instance.
- type: str
- resource_type:
- description:
- - Whether you want to deploy an image or create an instance from scratch.
- type: str
- choices: [ new, template ]
- zone:
- description:
- - Deploy the image to this oVirt cluster.
- type: str
- instance_disksize:
- description:
- - Size of the instance's disk in GB.
- type: str
- aliases: [ vm_disksize]
- instance_cpus:
- description:
- - The instance's number of CPUs.
- type: str
- default: 1
- aliases: [ vmcpus ]
- instance_nic:
- description:
- - The name of the network interface in oVirt/RHEV.
- type: str
- aliases: [ vmnic ]
- instance_network:
- description:
- - The logical network the machine should belong to.
- type: str
- default: rhevm
- aliases: [ vmnetwork ]
- instance_mem:
- description:
- - The instance's amount of memory in MB.
- type: str
- aliases: [ vmmem ]
- instance_type:
- description:
- - Define whether the instance is a server, desktop or high_performance.
- - I(high_performance) is supported since Ansible 2.5 and oVirt/RHV 4.2.
- type: str
- choices: [ desktop, server, high_performance ]
- default: server
- aliases: [ vmtype ]
- disk_alloc:
- description:
- - Define whether disk is thin or preallocated.
- type: str
- choices: [ preallocated, thin ]
- default: thin
- disk_int:
- description:
- - Interface type of the disk.
- type: str
- choices: [ ide, virtio ]
- default: virtio
- instance_os:
- description:
- - Type of Operating System.
- type: str
- aliases: [ vmos ]
- instance_cores:
- description:
- - Define the instance's number of cores.
- type: str
- default: 1
- aliases: [ vmcores ]
- sdomain:
- description:
- - The Storage Domain where you want to create the instance's disk on.
- type: str
- region:
- description:
- - The oVirt/RHEV datacenter where you want to deploy to.
- type: str
- instance_dns:
- description:
- - Define the instance's Primary DNS server.
- type: str
- aliases: [ dns ]
- instance_domain:
- description:
- - Define the instance's Domain.
- type: str
- aliases: [ domain ]
- instance_hostname:
- description:
- - Define the instance's Hostname.
- type: str
- aliases: [ hostname ]
- instance_ip:
- description:
- - Define the instance's IP.
- type: str
- aliases: [ ip ]
- instance_netmask:
- description:
- - Define the instance's Netmask.
- type: str
- aliases: [ netmask ]
- instance_gateway:
- description:
- - Define the instance's Gateway.
- type: str
- aliases: [ gateway ]
- instance_rootpw:
- description:
- - Define the instance's Root password.
- type: str
- aliases: [ rootpw ]
- instance_key:
- description:
- - Define the instance's Authorized key.
- type: str
- aliases: [ key ]
- state:
- description:
- - Create, terminate or remove instances.
- type: str
- choices: [ absent, present, restart, shutdown, started ]
- default: present
-requirements:
- - ovirt-engine-sdk-python
-'''
-
-EXAMPLES = '''
-- name: Basic example to provision from image
- community.general.ovirt:
- user: admin@internal
- url: https://ovirt.example.com
- instance_name: ansiblevm04
- password: secret
- image: centos_64
- zone: cluster01
- resource_type: template
-
-- name: Full example to create new instance from scratch
- community.general.ovirt:
- instance_name: testansible
- resource_type: new
- instance_type: server
- user: admin@internal
- password: secret
- url: https://ovirt.example.com
- instance_disksize: 10
- zone: cluster01
- region: datacenter1
- instance_cpus: 1
- instance_nic: nic1
- instance_network: rhevm
- instance_mem: 1000
- disk_alloc: thin
- sdomain: FIBER01
- instance_cores: 1
- instance_os: rhel_6x64
- disk_int: virtio
-
-- name: Stopping an existing instance
- community.general.ovirt:
- instance_name: testansible
- state: stopped
- user: admin@internal
- password: secret
- url: https://ovirt.example.com
-
-- name: Start an existing instance
- community.general.ovirt:
- instance_name: testansible
- state: started
- user: admin@internal
- password: secret
- url: https://ovirt.example.com
-
-- name: Start an instance with cloud init information
- community.general.ovirt:
- instance_name: testansible
- state: started
- user: admin@internal
- password: secret
- url: https://ovirt.example.com
- hostname: testansible
- domain: ansible.local
- ip: 192.0.2.100
- netmask: 255.255.255.0
- gateway: 192.0.2.1
- rootpw: bigsecret
-'''
-
-import time
-
-try:
- from ovirtsdk.api import API
- from ovirtsdk.xml import params
- HAS_OVIRTSDK = True
-except ImportError:
- HAS_OVIRTSDK = False
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils.common.removed import removed_module
-
-
-# ------------------------------------------------------------------- #
-# create connection with API
-#
-def conn(url, user, password):
- api = API(url=url, username=user, password=password, insecure=True)
- try:
- value = api.test()
- except Exception:
- raise Exception("error connecting to the oVirt API")
- return api
-
-
-# ------------------------------------------------------------------- #
-# Create VM from scratch
-def create_vm(conn, vmtype, vmname, zone, vmdisk_size, vmcpus, vmnic, vmnetwork, vmmem, vmdisk_alloc, sdomain, vmcores, vmos, vmdisk_int):
- if vmdisk_alloc == 'thin':
- # define VM params
- vmparams = params.VM(name=vmname, cluster=conn.clusters.get(name=zone), os=params.OperatingSystem(type_=vmos),
- template=conn.templates.get(name="Blank"), memory=1024 * 1024 * int(vmmem),
- cpu=params.CPU(topology=params.CpuTopology(cores=int(vmcores), sockets=vmcpus)), type_=vmtype)
- # define disk params
- vmdisk = params.Disk(size=1024 * 1024 * 1024 * int(vmdisk_size), wipe_after_delete=True, sparse=True, interface=vmdisk_int, type_="System",
- format='cow',
- storage_domains=params.StorageDomains(storage_domain=[conn.storagedomains.get(name=sdomain)]))
- # define network parameters
- network_net = params.Network(name=vmnetwork)
- nic_net1 = params.NIC(name='nic1', network=network_net, interface='virtio')
- elif vmdisk_alloc == 'preallocated':
- # define VM params
- vmparams = params.VM(name=vmname, cluster=conn.clusters.get(name=zone), os=params.OperatingSystem(type_=vmos),
- template=conn.templates.get(name="Blank"), memory=1024 * 1024 * int(vmmem),
- cpu=params.CPU(topology=params.CpuTopology(cores=int(vmcores), sockets=vmcpus)), type_=vmtype)
- # define disk params
- vmdisk = params.Disk(size=1024 * 1024 * 1024 * int(vmdisk_size), wipe_after_delete=True, sparse=False, interface=vmdisk_int, type_="System",
- format='raw', storage_domains=params.StorageDomains(storage_domain=[conn.storagedomains.get(name=sdomain)]))
- # define network parameters
- network_net = params.Network(name=vmnetwork)
- nic_net1 = params.NIC(name=vmnic, network=network_net, interface='virtio')
-
- try:
- conn.vms.add(vmparams)
- except Exception:
- raise Exception("Error creating VM with specified parameters")
- vm = conn.vms.get(name=vmname)
- try:
- vm.disks.add(vmdisk)
- except Exception:
- raise Exception("Error attaching disk")
- try:
- vm.nics.add(nic_net1)
- except Exception:
- raise Exception("Error adding nic")
-
-
-# create an instance from a template
-def create_vm_template(conn, vmname, image, zone):
- vmparams = params.VM(name=vmname, cluster=conn.clusters.get(name=zone), template=conn.templates.get(name=image), disks=params.Disks(clone=True))
- try:
- conn.vms.add(vmparams)
- except Exception:
- raise Exception('error adding template %s' % image)
-
-
-# start instance
-def vm_start(conn, vmname, hostname=None, ip=None, netmask=None, gateway=None,
- domain=None, dns=None, rootpw=None, key=None):
- vm = conn.vms.get(name=vmname)
- use_cloud_init = False
- nics = None
- nic = None
- if hostname or ip or netmask or gateway or domain or dns or rootpw or key:
- use_cloud_init = True
- if ip and netmask and gateway:
- ipinfo = params.IP(address=ip, netmask=netmask, gateway=gateway)
- nic = params.GuestNicConfiguration(name='eth0', boot_protocol='STATIC', ip=ipinfo, on_boot=True)
- nics = params.Nics()
- nics = params.GuestNicsConfiguration(nic_configuration=[nic])
- initialization = params.Initialization(regenerate_ssh_keys=True, host_name=hostname, domain=domain, user_name='root',
- root_password=rootpw, nic_configurations=nics, dns_servers=dns,
- authorized_ssh_keys=key)
- action = params.Action(use_cloud_init=use_cloud_init, vm=params.VM(initialization=initialization))
- vm.start(action=action)
-
-
-# Stop instance
-def vm_stop(conn, vmname):
- vm = conn.vms.get(name=vmname)
- vm.stop()
-
-
-# restart instance
-def vm_restart(conn, vmname):
- state = vm_status(conn, vmname)
- vm = conn.vms.get(name=vmname)
- vm.stop()
- while conn.vms.get(vmname).get_status().get_state() != 'down':
- time.sleep(5)
- vm.start()
-
-
-# remove an instance
-def vm_remove(conn, vmname):
- vm = conn.vms.get(name=vmname)
- vm.delete()
-
-
-# ------------------------------------------------------------------- #
-# VM statuses
-#
-# Get the VMs status
-def vm_status(conn, vmname):
- status = conn.vms.get(name=vmname).status.state
- return status
-
-
-# Get VM object and return it's name if object exists
-def get_vm(conn, vmname):
- vm = conn.vms.get(name=vmname)
- if vm is None:
- name = "empty"
- else:
- name = vm.get_name()
- return name
-
-# ------------------------------------------------------------------- #
-# Hypervisor operations
-#
-# not available yet
-# ------------------------------------------------------------------- #
-# Main
-
-
-def main():
- module = AnsibleModule(
- argument_spec=dict(
- state=dict(type='str', default='present', choices=['absent', 'present', 'restart', 'shutdown', 'started']),
- user=dict(type='str', required=True),
- url=dict(type='str', required=True),
- instance_name=dict(type='str', required=True, aliases=['vmname']),
- password=dict(type='str', required=True, no_log=True),
- image=dict(type='str'),
- resource_type=dict(type='str', choices=['new', 'template']),
- zone=dict(type='str'),
- instance_disksize=dict(type='str', aliases=['vm_disksize']),
- instance_cpus=dict(type='str', default=1, aliases=['vmcpus']),
- instance_nic=dict(type='str', aliases=['vmnic']),
- instance_network=dict(type='str', default='rhevm', aliases=['vmnetwork']),
- instance_mem=dict(type='str', aliases=['vmmem']),
- instance_type=dict(type='str', default='server', aliases=['vmtype'], choices=['desktop', 'server', 'high_performance']),
- disk_alloc=dict(type='str', default='thin', choices=['preallocated', 'thin']),
- disk_int=dict(type='str', default='virtio', choices=['ide', 'virtio']),
- instance_os=dict(type='str', aliases=['vmos']),
- instance_cores=dict(type='str', default=1, aliases=['vmcores']),
- instance_hostname=dict(type='str', aliases=['hostname']),
- instance_ip=dict(type='str', aliases=['ip']),
- instance_netmask=dict(type='str', aliases=['netmask']),
- instance_gateway=dict(type='str', aliases=['gateway']),
- instance_domain=dict(type='str', aliases=['domain']),
- instance_dns=dict(type='str', aliases=['dns']),
- instance_rootpw=dict(type='str', aliases=['rootpw'], no_log=True),
- instance_key=dict(type='str', aliases=['key'], no_log=True),
- sdomain=dict(type='str'),
- region=dict(type='str'),
- ),
- )
-
- if not HAS_OVIRTSDK:
- module.fail_json(msg='ovirtsdk required for this module')
-
- state = module.params['state']
- user = module.params['user']
- url = module.params['url']
- vmname = module.params['instance_name']
- password = module.params['password']
- image = module.params['image'] # name of the image to deploy
- resource_type = module.params['resource_type'] # template or from scratch
- zone = module.params['zone'] # oVirt cluster
- vmdisk_size = module.params['instance_disksize'] # disksize
- vmcpus = module.params['instance_cpus'] # number of cpu
- vmnic = module.params['instance_nic'] # network interface
- vmnetwork = module.params['instance_network'] # logical network
- vmmem = module.params['instance_mem'] # mem size
- vmdisk_alloc = module.params['disk_alloc'] # thin, preallocated
- vmdisk_int = module.params['disk_int'] # disk interface virtio or ide
- vmos = module.params['instance_os'] # Operating System
- vmtype = module.params['instance_type'] # server, desktop or high_performance
- vmcores = module.params['instance_cores'] # number of cores
- sdomain = module.params['sdomain'] # storage domain to store disk on
- region = module.params['region'] # oVirt Datacenter
- hostname = module.params['instance_hostname']
- ip = module.params['instance_ip']
- netmask = module.params['instance_netmask']
- gateway = module.params['instance_gateway']
- domain = module.params['instance_domain']
- dns = module.params['instance_dns']
- rootpw = module.params['instance_rootpw']
- key = module.params['instance_key']
- # initialize connection
- try:
- c = conn(url + "/api", user, password)
- except Exception as e:
- module.fail_json(msg='%s' % e)
-
- if state == 'present':
- if get_vm(c, vmname) == "empty":
- if resource_type == 'template':
- try:
- create_vm_template(c, vmname, image, zone)
- except Exception as e:
- module.fail_json(msg='%s' % e)
- module.exit_json(changed=True, msg="deployed VM %s from template %s" % (vmname, image))
- elif resource_type == 'new':
- # FIXME: refactor, use keyword args.
- try:
- create_vm(c, vmtype, vmname, zone, vmdisk_size, vmcpus, vmnic, vmnetwork, vmmem, vmdisk_alloc, sdomain, vmcores, vmos, vmdisk_int)
- except Exception as e:
- module.fail_json(msg='%s' % e)
- module.exit_json(changed=True, msg="deployed VM %s from scratch" % vmname)
- else:
- module.exit_json(changed=False, msg="You did not specify a resource type")
- else:
- module.exit_json(changed=False, msg="VM %s already exists" % vmname)
-
- if state == 'started':
- if vm_status(c, vmname) == 'up':
- module.exit_json(changed=False, msg="VM %s is already running" % vmname)
- else:
- # vm_start(c, vmname)
- vm_start(c, vmname, hostname, ip, netmask, gateway, domain, dns, rootpw, key)
- module.exit_json(changed=True, msg="VM %s started" % vmname)
-
- if state == 'shutdown':
- if vm_status(c, vmname) == 'down':
- module.exit_json(changed=False, msg="VM %s is already shutdown" % vmname)
- else:
- vm_stop(c, vmname)
- module.exit_json(changed=True, msg="VM %s is shutting down" % vmname)
-
- if state == 'restart':
- if vm_status(c, vmname) == 'up':
- vm_restart(c, vmname)
- module.exit_json(changed=True, msg="VM %s is restarted" % vmname)
- else:
- module.exit_json(changed=False, msg="VM %s is not running" % vmname)
-
- if state == 'absent':
- if get_vm(c, vmname) == "empty":
- module.exit_json(changed=False, msg="VM %s does not exist" % vmname)
- else:
- vm_remove(c, vmname)
- module.exit_json(changed=True, msg="VM %s removed" % vmname)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/online/online_server_facts.py b/plugins/modules/cloud/online/online_server_facts.py
deleted file mode 100644
index f1e74aa6f0..0000000000
--- a/plugins/modules/cloud/online/online_server_facts.py
+++ /dev/null
@@ -1,175 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# 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
-
-DOCUMENTATION = r'''
----
-module: online_server_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(community.general.online_server_info) instead.
-short_description: Gather facts about Online servers.
-description:
- - Gather facts about the servers.
- - U(https://www.online.net/en/dedicated-server)
-author:
- - "Remy Leone (@sieben)"
-extends_documentation_fragment:
-- community.general.online
-
-'''
-
-EXAMPLES = r'''
-- name: Gather Online server facts
- community.general.online_server_facts:
- api_token: '0d1627e8-bbf0-44c5-a46f-5c4d3aef033f'
-'''
-
-RETURN = r'''
----
-online_server_facts:
- description: Response from Online API
- returned: success
- type: complex
- sample:
- "online_server_facts": [
- {
- "abuse": "abuse@example.com",
- "anti_ddos": false,
- "bmc": {
- "session_key": null
- },
- "boot_mode": "normal",
- "contacts": {
- "owner": "foobar",
- "tech": "foobar"
- },
- "disks": [
- {
- "$ref": "/api/v1/server/hardware/disk/68452"
- },
- {
- "$ref": "/api/v1/server/hardware/disk/68453"
- }
- ],
- "drive_arrays": [
- {
- "disks": [
- {
- "$ref": "/api/v1/server/hardware/disk/68452"
- },
- {
- "$ref": "/api/v1/server/hardware/disk/68453"
- }
- ],
- "raid_controller": {
- "$ref": "/api/v1/server/hardware/raidController/9910"
- },
- "raid_level": "RAID1"
- }
- ],
- "hardware_watch": true,
- "hostname": "sd-42",
- "id": 42,
- "ip": [
- {
- "address": "195.154.172.149",
- "mac": "28:92:4a:33:5e:c6",
- "reverse": "195-154-172-149.rev.poneytelecom.eu.",
- "switch_port_state": "up",
- "type": "public"
- },
- {
- "address": "10.90.53.212",
- "mac": "28:92:4a:33:5e:c7",
- "reverse": null,
- "switch_port_state": "up",
- "type": "private"
- }
- ],
- "last_reboot": "2018-08-23T08:32:03.000Z",
- "location": {
- "block": "A",
- "datacenter": "DC3",
- "position": 19,
- "rack": "A23",
- "room": "4 4-4"
- },
- "network": {
- "ip": [
- "195.154.172.149"
- ],
- "ipfo": [],
- "private": [
- "10.90.53.212"
- ]
- },
- "offer": "Pro-1-S-SATA",
- "os": {
- "name": "FreeBSD",
- "version": "11.1-RELEASE"
- },
- "power": "ON",
- "proactive_monitoring": false,
- "raid_controllers": [
- {
- "$ref": "/api/v1/server/hardware/raidController/9910"
- }
- ],
- "support": "Basic service level"
- }
- ]
-'''
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils.online import (
- Online, OnlineException, online_argument_spec
-)
-
-
-class OnlineServerFacts(Online):
-
- def __init__(self, module):
- super(OnlineServerFacts, self).__init__(module)
- self.name = 'api/v1/server'
-
- def _get_server_detail(self, server_path):
- try:
- return self.get(path=server_path).json
- except OnlineException as exc:
- self.module.fail_json(msg="A problem occurred while fetching: %s (%s)" % (server_path, exc))
-
- def all_detailed_servers(self):
- servers_api_path = self.get_resources()
-
- server_data = (
- self._get_server_detail(server_api_path)
- for server_api_path in servers_api_path
- )
-
- return [s for s in server_data if s is not None]
-
-
-def main():
- module = AnsibleModule(
- argument_spec=online_argument_spec(),
- supports_check_mode=True,
- )
-
- try:
- servers_facts = OnlineServerFacts(module).all_detailed_servers()
- module.exit_json(
- ansible_facts={'online_server_facts': servers_facts}
- )
- except OnlineException as exc:
- module.fail_json(msg=exc.message)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/online/online_user_facts.py b/plugins/modules/cloud/online/online_user_facts.py
deleted file mode 100644
index 7b78924e92..0000000000
--- a/plugins/modules/cloud/online/online_user_facts.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# 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
-
-DOCUMENTATION = r'''
----
-module: online_user_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(community.general.online_user_info) instead.
-short_description: Gather facts about Online user.
-description:
- - Gather facts about the user.
-author:
- - "Remy Leone (@sieben)"
-extends_documentation_fragment:
-- community.general.online
-
-'''
-
-EXAMPLES = r'''
-- name: Gather Online user facts
- community.general.online_user_facts:
-'''
-
-RETURN = r'''
----
-online_user_facts:
- description: Response from Online API
- returned: success
- type: complex
- sample:
- "online_user_facts": {
- "company": "foobar LLC",
- "email": "foobar@example.com",
- "first_name": "foo",
- "id": 42,
- "last_name": "bar",
- "login": "foobar"
- }
-'''
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils.online import (
- Online, OnlineException, online_argument_spec
-)
-
-
-class OnlineUserFacts(Online):
-
- def __init__(self, module):
- super(OnlineUserFacts, self).__init__(module)
- self.name = 'api/v1/user'
-
-
-def main():
- module = AnsibleModule(
- argument_spec=online_argument_spec(),
- supports_check_mode=True,
- )
-
- try:
- module.exit_json(
- ansible_facts={'online_user_facts': OnlineUserFacts(module).get_resources()}
- )
- except OnlineException as exc:
- module.fail_json(msg=exc.message)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/opennebula/one_image_facts.py b/plugins/modules/cloud/opennebula/one_image_facts.py
deleted file mode 120000
index 96b8357316..0000000000
--- a/plugins/modules/cloud/opennebula/one_image_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-one_image_info.py
\ No newline at end of file
diff --git a/plugins/modules/cloud/opennebula/one_image_info.py b/plugins/modules/cloud/opennebula/one_image_info.py
index 77c280d07b..e03b8ad724 100644
--- a/plugins/modules/cloud/opennebula/one_image_info.py
+++ b/plugins/modules/cloud/opennebula/one_image_info.py
@@ -261,9 +261,6 @@ def main():
module = AnsibleModule(argument_spec=fields,
mutually_exclusive=[['ids', 'name']],
supports_check_mode=True)
- if module._name in ('one_image_facts', 'community.general.one_image_facts'):
- module.deprecate("The 'one_image_facts' module has been renamed to 'one_image_info'",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
if not HAS_PYONE:
module.fail_json(msg='This module requires pyone to work!')
diff --git a/plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py b/plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py
deleted file mode 100644
index e560e13e30..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py
+++ /dev/null
@@ -1,196 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_affinity_label_facts
-short_description: Retrieve information about one or more oVirt/RHV affinity labels
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_affinity_label_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV affinity labels."
-notes:
- - "This module returns a variable C(ovirt_affinity_labels), which
- contains a list of affinity labels. You need to register the result with
- the I(register) keyword to use it."
-options:
- name:
- description:
- - "Name of the affinity labels which should be listed."
- vm:
- description:
- - "Name of the VM, which affinity labels should be listed."
- host:
- description:
- - "Name of the host, which affinity labels should be listed."
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all affinity labels, which names start with label
- ovirt_affinity_label_info:
- name: label*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_affinity_labels }}"
-
-- name: >
- Gather information about all affinity labels, which are assigned to VMs
- which names start with postgres
- ovirt_affinity_label_info:
- vm: postgres*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_affinity_labels }}"
-
-- name: >
- Gather information about all affinity labels, which are assigned to hosts
- which names start with west
- ovirt_affinity_label_info:
- host: west*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_affinity_labels }}"
-
-- name: >
- Gather information about all affinity labels, which are assigned to hosts
- which names start with west or VMs which names start with postgres
- ovirt_affinity_label_info:
- host: west*
- vm: postgres*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_affinity_labels }}"
-'''
-
-RETURN = '''
-ovirt_affinity_labels:
- description: "List of dictionaries describing the affinity labels. Affinity labels attributes are mapped to dictionary keys,
- all affinity labels attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/affinity_label."
- returned: On success.
- type: list
-'''
-
-import fnmatch
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
- search_by_name,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- name=dict(default=None),
- host=dict(default=None),
- vm=dict(default=None),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_affinity_label_facts', 'community.general.ovirt_affinity_label_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_affinity_label_facts' module has been renamed to 'ovirt_affinity_label_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- affinity_labels_service = connection.system_service().affinity_labels_service()
- labels = []
- all_labels = affinity_labels_service.list()
- if module.params['name']:
- labels.extend([
- l for l in all_labels
- if fnmatch.fnmatch(l.name, module.params['name'])
- ])
- if module.params['host']:
- hosts_service = connection.system_service().hosts_service()
- if search_by_name(hosts_service, module.params['host']) is None:
- raise Exception("Host '%s' was not found." % module.params['host'])
- labels.extend([
- label
- for label in all_labels
- for host in connection.follow_link(label.hosts)
- if fnmatch.fnmatch(hosts_service.service(host.id).get().name, module.params['host'])
- ])
- if module.params['vm']:
- vms_service = connection.system_service().vms_service()
- if search_by_name(vms_service, module.params['vm']) is None:
- raise Exception("Vm '%s' was not found." % module.params['vm'])
- labels.extend([
- label
- for label in all_labels
- for vm in connection.follow_link(label.vms)
- if fnmatch.fnmatch(vms_service.service(vm.id).get().name, module.params['vm'])
- ])
-
- if not (module.params['vm'] or module.params['host'] or module.params['name']):
- labels = all_labels
-
- result = dict(
- ovirt_affinity_labels=[
- get_dict_of_struct(
- struct=l,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for l in labels
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_api_facts.py b/plugins/modules/cloud/ovirt/ovirt_api_facts.py
deleted file mode 100644
index 4085a7022b..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_api_facts.py
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# Copyright (c) 2017 Ansible Project
-# 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
-
-
-DOCUMENTATION = '''
----
-module: ovirt_api_facts
-short_description: Retrieve information about the oVirt/RHV API
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_api_info) instead.
-description:
- - "Retrieve information about the oVirt/RHV API."
-notes:
- - "This module returns a variable C(ovirt_api),
- which contains a information about oVirt/RHV API. You need to register the result with
- the I(register) keyword to use it."
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information oVirt API
- ovirt_api_info:
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_api }}"
-'''
-
-RETURN = '''
-ovirt_api:
- description: "Dictionary describing the oVirt API information.
- Api attributes are mapped to dictionary keys,
- all API attributes can be found at following
- url: https://ovirt.example.com/ovirt-engine/api/model#types/api."
- returned: On success.
- type: dict
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec()
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_api_facts', 'community.general.ovirt_api_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_api_facts' module has been renamed to 'ovirt_api_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- api = connection.system_service().get()
- result = dict(
- ovirt_api=get_dict_of_struct(
- struct=api,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- )
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_cluster_facts.py b/plugins/modules/cloud/ovirt/ovirt_cluster_facts.py
deleted file mode 100644
index e4916a2684..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_cluster_facts.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_cluster_facts
-short_description: Retrieve information about one or more oVirt/RHV clusters
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_cluster_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV clusters."
-notes:
- - "This module returns a variable C(ovirt_clusters), which
- contains a list of clusters. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search cluster X from datacenter Y use following pattern:
- name=X and datacenter=Y"
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all clusters which names start with production
- ovirt_cluster_info:
- pattern:
- name: 'production*'
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_clusters }}"
-'''
-
-RETURN = '''
-ovirt_clusters:
- description: "List of dictionaries describing the clusters. Cluster attributes are mapped to dictionary keys,
- all clusters attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/cluster."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_cluster_facts', 'community.general.ovirt_cluster_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_cluster_facts' module has been renamed to 'ovirt_cluster_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- clusters_service = connection.system_service().clusters_service()
- clusters = clusters_service.list(search=module.params['pattern'])
- result = dict(
- ovirt_clusters=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in clusters
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py b/plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py
deleted file mode 100644
index 0de7272939..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/usr/bin/python
-# -*- 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
-
-DOCUMENTATION = '''
----
-module: ovirt_datacenter_facts
-short_description: Retrieve information about one or more oVirt/RHV datacenters
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_datacenter_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV datacenters."
-notes:
- - "This module returns a variable C(ovirt_datacenters), which
- contains a list of datacenters. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search datacenter I(X) use following pattern: I(name=X)"
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all data centers which names start with production
- ovirt_datacenter_info:
- pattern: name=production*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_datacenters }}"
-'''
-
-RETURN = '''
-ovirt_datacenters:
- description: "List of dictionaries describing the datacenters. Datacenter attributes are mapped to dictionary keys,
- all datacenters attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/data_center."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_datacenter_facts', 'community.general.ovirt_datacenter_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_datacenter_facts' module has been renamed to 'ovirt_datacenter_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- datacenters_service = connection.system_service().data_centers_service()
- datacenters = datacenters_service.list(search=module.params['pattern'])
- result = dict(
- ovirt_datacenters=[
- get_dict_of_struct(
- struct=d,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for d in datacenters
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_disk_facts.py b/plugins/modules/cloud/ovirt/ovirt_disk_facts.py
deleted file mode 100644
index 6e0c9f699d..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_disk_facts.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright (c) 2017 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_disk_facts
-short_description: Retrieve information about one or more oVirt/RHV disks
-author: "Katerina Koukiou (@KKoukiou)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_disk_info) instead
-description:
- - "Retrieve information about one or more oVirt/RHV disks."
-notes:
- - "This module returns a variable C(ovirt_disks), which
- contains a list of disks. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search Disk X from storage Y use following pattern:
- name=X and storage.name=Y"
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all Disks which names start with centos
- ovirt_disk_info:
- pattern: name=centos*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_disks }}"
-'''
-
-RETURN = '''
-ovirt_disks:
- description: "List of dictionaries describing the Disks. Disk attributes are mapped to dictionary keys,
- all Disks attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/disk."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_disk_facts', 'community.general.ovirt_disk_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_disk_facts' module has been renamed to 'ovirt_disk_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- disks_service = connection.system_service().disks_service()
- disks = disks_service.list(
- search=module.params['pattern'],
- )
- result = dict(
- ovirt_disks=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in disks
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_event_facts.py b/plugins/modules/cloud/ovirt/ovirt_event_facts.py
deleted file mode 100644
index 50a2065498..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_event_facts.py
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright: (c) 2019, Ansible Project
-# 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
-
-DOCUMENTATION = '''
----
-module: ovirt_event_facts
-short_description: This module can be used to retrieve information about one or more oVirt/RHV events
-author: "Chris Keller (@nasx)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_event_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV events."
-options:
- case_sensitive:
- description:
- - "Indicates if the search performed using the search parameter should be performed taking case
- into account. The default value is true, which means that case is taken into account. If you
- want to search ignoring case set it to false."
- required: false
- default: true
- type: bool
-
- from_:
- description:
- - "Indicates the event index after which events should be returned. The indexes of events are
- strictly increasing, so when this parameter is used only the events with greater indexes
- will be returned."
- required: false
- type: int
-
- max:
- description:
- - "Sets the maximum number of events to return. If not specified all the events are returned."
- required: false
- type: int
-
- search:
- description:
- - "Search term which is accepted by the oVirt/RHV API."
- - "For example to search for events of severity alert use the following pattern: severity=alert"
- required: false
- type: str
-
- headers:
- description:
- - "Additional HTTP headers."
- required: false
- type: str
-
- query:
- description:
- - "Additional URL query parameters."
- required: false
- type: str
-
- wait:
- description:
- - "If True wait for the response."
- required: false
- default: true
- type: bool
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain the auth parameter for simplicity,
-# look at the ovirt_auth module to see how to reuse authentication.
-
-- name: Return all events
- ovirt_event_info:
- register: result
-
-- name: Return the last 10 events
- ovirt_event_info:
- max: 10
- register: result
-
-- name: Return all events of type alert
- ovirt_event_info:
- search: "severity=alert"
- register: result
-- ansible.builtin.debug:
- msg: "{{ result.ovirt_events }}"
-'''
-
-RETURN = '''
-ovirt_events:
- description: "List of dictionaries describing the events. Event attributes are mapped to dictionary keys.
- All event attributes can be found at the following url:
- http://ovirt.github.io/ovirt-engine-api-model/master/#types/event"
- returned: On success."
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- case_sensitive=dict(default=True, type='bool', required=False),
- from_=dict(default=None, type='int', required=False),
- max=dict(default=None, type='int', required=False),
- search=dict(default='', required=False),
- headers=dict(default='', required=False),
- query=dict(default='', required=False),
- wait=dict(default=True, type='bool', required=False)
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_event_facts', 'community.general.ovirt_event_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_event_facts' module has been renamed to 'ovirt_event_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- events_service = connection.system_service().events_service()
- events = events_service.list(
- case_sensitive=module.params['case_sensitive'],
- from_=module.params['from_'],
- max=module.params['max'],
- search=module.params['search'],
- headers=module.params['headers'],
- query=module.params['query'],
- wait=module.params['wait']
- )
-
- result = dict(
- ovirt_events=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in events
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py b/plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py
deleted file mode 100644
index f9ac8b9777..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py
+++ /dev/null
@@ -1,165 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_external_provider_facts
-short_description: Retrieve information about one or more oVirt/RHV external providers
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_external_provider_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV external providers."
-notes:
- - "This module returns a variable C(ovirt_external_providers), which
- contains a list of external_providers. You need to register the result with
- the I(register) keyword to use it."
-options:
- type:
- description:
- - "Type of the external provider."
- choices: ['os_image', 'os_network', 'os_volume', 'foreman']
- required: true
- type: str
- name:
- description:
- - "Name of the external provider, can be used as glob expression."
- type: str
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all image external providers named glance
- ovirt_external_provider_info:
- type: os_image
- name: glance
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_external_providers }}"
-'''
-
-RETURN = '''
-ovirt_external_providers:
- description:
- - "List of dictionaries. Content depends on I(type)."
- - "For type C(foreman), attributes appearing in the dictionary can be found on your oVirt/RHV instance
- at the following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/external_host_provider."
- - "For type C(os_image), attributes appearing in the dictionary can be found on your oVirt/RHV instance
- at the following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/openstack_image_provider."
- - "For type C(os_volume), attributes appearing in the dictionary can be found on your oVirt/RHV instance
- at the following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/openstack_volume_provider."
- - "For type C(os_network), attributes appearing in the dictionary can be found on your oVirt/RHV instance
- at the following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/openstack_network_provider."
- returned: On success
- type: list
-'''
-
-import fnmatch
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def _external_provider_service(provider_type, system_service):
- if provider_type == 'os_image':
- return system_service.openstack_image_providers_service()
- elif provider_type == 'os_network':
- return system_service.openstack_network_providers_service()
- elif provider_type == 'os_volume':
- return system_service.openstack_volume_providers_service()
- elif provider_type == 'foreman':
- return system_service.external_host_providers_service()
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- name=dict(default=None, required=False),
- type=dict(
- required=True,
- choices=['os_image', 'os_network', 'os_volume', 'foreman'],
- aliases=['provider'],
- ),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_external_provider_facts', 'community.general.ovirt_external_provider_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_external_provider_facts' module has been renamed to 'ovirt_external_provider_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- external_providers_service = _external_provider_service(
- provider_type=module.params.pop('type'),
- system_service=connection.system_service(),
- )
- if module.params['name']:
- external_providers = [
- e for e in external_providers_service.list()
- if fnmatch.fnmatch(e.name, module.params['name'])
- ]
- else:
- external_providers = external_providers_service.list()
-
- result = dict(
- ovirt_external_providers=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in external_providers
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_group_facts.py b/plugins/modules/cloud/ovirt/ovirt_group_facts.py
deleted file mode 100644
index 40b037f4ee..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_group_facts.py
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_group_facts
-short_description: Retrieve information about one or more oVirt/RHV groups
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_group_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV groups."
-notes:
- - "This module returns a variable C(ovirt_groups), which
- contains a list of groups. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search group X use following pattern: name=X"
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all groups which names start with admin
- ovirt_group_info:
- pattern: name=admin*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_groups }}"
-'''
-
-RETURN = '''
-ovirt_groups:
- description: "List of dictionaries describing the groups. Group attributes are mapped to dictionary keys,
- all groups attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/group."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_group_facts', 'community.general.ovirt_group_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_group_facts' module has been renamed to 'ovirt_group_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- groups_service = connection.system_service().groups_service()
- groups = groups_service.list(search=module.params['pattern'])
- result = dict(
- ovirt_groups=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in groups
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_host_facts.py b/plugins/modules/cloud/ovirt/ovirt_host_facts.py
deleted file mode 100644
index ea585e9051..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_host_facts.py
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/usr/bin/python
-# -*- 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
-
-DOCUMENTATION = '''
----
-module: ovirt_host_facts
-short_description: Retrieve information about one or more oVirt/RHV hosts
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_host_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV hosts."
-notes:
- - "This module returns a variable C(ovirt_hosts), which
- contains a list of hosts. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search host X from datacenter Y use following pattern:
- name=X and datacenter=Y"
- all_content:
- description:
- - "If I(true) all the attributes of the hosts should be
- included in the response."
- default: False
- type: bool
- cluster_version:
- description:
- - "Filter the hosts based on the cluster version."
- type: str
-
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all hosts which names start with host and belong to data center west
- ovirt_host_info:
- pattern: name=host* and datacenter=west
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_hosts }}"
-
-- name: Gather information about all hosts with cluster version 4.2
- ovirt_host_info:
- pattern: name=host*
- cluster_version: "4.2"
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_hosts }}"
-'''
-
-RETURN = '''
-ovirt_hosts:
- description: "List of dictionaries describing the hosts. Host attributes are mapped to dictionary keys,
- all hosts attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/host."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def get_filtered_hosts(cluster_version, hosts, connection):
- # Filtering by cluster version returns only those which have same cluster version as input
- filtered_hosts = []
- for host in hosts:
- cluster = connection.follow_link(host.cluster)
- cluster_version_host = str(cluster.version.major) + '.' + str(cluster.version.minor)
- if cluster_version_host == cluster_version:
- filtered_hosts.append(host)
- return filtered_hosts
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- all_content=dict(default=False, type='bool'),
- cluster_version=dict(default=None, type='str'),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_host_facts', 'community.general.ovirt_host_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_host_facts' module has been renamed to 'ovirt_host_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- hosts_service = connection.system_service().hosts_service()
- hosts = hosts_service.list(
- search=module.params['pattern'],
- all_content=module.params['all_content']
- )
- cluster_version = module.params.get('cluster_version')
- if cluster_version is not None:
- hosts = get_filtered_hosts(cluster_version, hosts, connection)
- result = dict(
- ovirt_hosts=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in hosts
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py b/plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py
deleted file mode 100644
index 62af3e4ba1..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py
+++ /dev/null
@@ -1,187 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright (c) 2017 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
-
-DOCUMENTATION = '''
----
-module: ovirt_host_storage_facts
-short_description: Retrieve information about one or more oVirt/RHV HostStorages (applicable only for block storage)
-author: "Daniel Erez (@derez)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_host_storage_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV HostStorages (applicable only for block storage)."
-options:
- host:
- description:
- - "Host to get device list from."
- required: true
- iscsi:
- description:
- - "Dictionary with values for iSCSI storage type:"
- suboptions:
- address:
- description:
- - "Address of the iSCSI storage server."
- target:
- description:
- - "The target IQN for the storage device."
- username:
- description:
- - "A CHAP user name for logging into a target."
- password:
- description:
- - "A CHAP password for logging into a target."
- portal:
- description:
- - "The portal being used to connect with iscsi."
- fcp:
- description:
- - "Dictionary with values for fibre channel storage type:"
- suboptions:
- address:
- description:
- - "Address of the fibre channel storage server."
- port:
- description:
- - "Port of the fibre channel storage server."
- lun_id:
- description:
- - "LUN id."
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about HostStorages with specified target and address
- ovirt_host_storage_info:
- host: myhost
- iscsi:
- target: iqn.2016-08-09.domain-01:nickname
- address: 10.34.63.204
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_host_storages }}"
-'''
-
-RETURN = '''
-ovirt_host_storages:
- description: "List of dictionaries describing the HostStorage. HostStorage attributes are mapped to dictionary keys,
- all HostStorage attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/host_storage."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-try:
- import ovirtsdk4.types as otypes
-except ImportError:
- pass
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
- get_id_by_name,
-)
-
-
-def _login(host_service, iscsi):
- host_service.iscsi_login(
- iscsi=otypes.IscsiDetails(
- username=iscsi.get('username'),
- password=iscsi.get('password'),
- address=iscsi.get('address'),
- target=iscsi.get('target'),
- portal=iscsi.get('portal')
- ),
- )
-
-
-def _get_storage_type(params):
- for sd_type in ['iscsi', 'fcp']:
- if params.get(sd_type) is not None:
- return sd_type
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- host=dict(required=True),
- iscsi=dict(default=None, type='dict'),
- fcp=dict(default=None, type='dict'),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_host_storage_facts', 'community.general.ovirt_host_storage_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_host_storage_facts' module has been renamed to 'ovirt_host_storage_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
-
- # Get Host
- hosts_service = connection.system_service().hosts_service()
- host_id = get_id_by_name(hosts_service, module.params['host'])
- storage_type = _get_storage_type(module.params)
- host_service = hosts_service.host_service(host_id)
-
- if storage_type == 'iscsi':
- # Login
- iscsi = module.params.get('iscsi')
- _login(host_service, iscsi)
-
- # Get LUNs exposed from the specified target
- host_storages = host_service.storage_service().list()
-
- if storage_type == 'iscsi':
- filterred_host_storages = [host_storage for host_storage in host_storages
- if host_storage.type == otypes.StorageType.ISCSI]
- if 'target' in iscsi:
- filterred_host_storages = [host_storage for host_storage in filterred_host_storages
- if iscsi.get('target') == host_storage.logical_units[0].target]
- elif storage_type == 'fcp':
- filterred_host_storages = [host_storage for host_storage in host_storages
- if host_storage.type == otypes.StorageType.FCP]
-
- result = dict(
- ovirt_host_storages=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in filterred_host_storages
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_network_facts.py b/plugins/modules/cloud/ovirt/ovirt_network_facts.py
deleted file mode 100644
index 781dd85805..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_network_facts.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_network_facts
-short_description: Retrieve information about one or more oVirt/RHV networks
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_network_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV networks."
-notes:
- - "This module returns a variable C(ovirt_networks), which
- contains a list of networks. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search network starting with string vlan1 use: name=vlan1*"
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all networks which names start with vlan1
- ovirt_network_info:
- pattern: name=vlan1*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_networks }}"
-'''
-
-
-RETURN = '''
-ovirt_networks:
- description: "List of dictionaries describing the networks. Network attributes are mapped to dictionary keys,
- all networks attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/network."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_network_facts', 'community.general.ovirt_network_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_network_facts' module has been renamed to 'ovirt_network_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- networks_service = connection.system_service().networks_service()
- networks = networks_service.list(search=module.params['pattern'])
- result = dict(
- ovirt_networks=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in networks
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_nic_facts.py b/plugins/modules/cloud/ovirt/ovirt_nic_facts.py
deleted file mode 100644
index 2cc1194fbc..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_nic_facts.py
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_nic_facts
-short_description: Retrieve information about one or more oVirt/RHV virtual machine network interfaces
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_nic_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV virtual machine network interfaces."
-notes:
- - "This module returns a variable C(ovirt_nics), which
- contains a list of NICs. You need to register the result with
- the I(register) keyword to use it."
-options:
- vm:
- description:
- - "Name of the VM where NIC is attached."
- required: true
- name:
- description:
- - "Name of the NIC, can be used as glob expression."
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all NICs which names start with eth for VM named centos7
- ovirt_nic_info:
- vm: centos7
- name: eth*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_nics }}"
-'''
-
-RETURN = '''
-ovirt_nics:
- description: "List of dictionaries describing the network interfaces. NIC attributes are mapped to dictionary keys,
- all NICs attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/nic."
- returned: On success.
- type: list
-'''
-
-import fnmatch
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
- search_by_name,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- vm=dict(required=True),
- name=dict(default=None),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_nic_facts', 'community.general.ovirt_nic_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_nic_facts' module has been renamed to 'ovirt_nic_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- vms_service = connection.system_service().vms_service()
- vm_name = module.params['vm']
- vm = search_by_name(vms_service, vm_name)
- if vm is None:
- raise Exception("VM '%s' was not found." % vm_name)
-
- nics_service = vms_service.service(vm.id).nics_service()
- if module.params['name']:
- nics = [
- e for e in nics_service.list()
- if fnmatch.fnmatch(e.name, module.params['name'])
- ]
- else:
- nics = nics_service.list()
-
- result = dict(
- ovirt_nics=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in nics
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_permission_facts.py b/plugins/modules/cloud/ovirt/ovirt_permission_facts.py
deleted file mode 100644
index 52ba3624f1..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_permission_facts.py
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_permission_facts
-short_description: Retrieve information about one or more oVirt/RHV permissions
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_permission_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV permissions."
-notes:
- - "This module returns a variable C(ovirt_permissions), which
- contains a list of permissions. You need to register the result with
- the I(register) keyword to use it."
-options:
- user_name:
- description:
- - "Username of the user to manage. In most LDAPs it's I(uid) of the user, but in Active Directory you must specify I(UPN) of the user."
- group_name:
- description:
- - "Name of the group to manage."
- authz_name:
- description:
- - "Authorization provider of the user/group. In previous versions of oVirt/RHV known as domain."
- required: true
- aliases: ['domain']
- namespace:
- description:
- - "Namespace of the authorization provider, where user/group resides."
- required: false
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all permissions of user with username john
- ovirt_permission_info:
- user_name: john
- authz_name: example.com-authz
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_permissions }}"
-'''
-
-RETURN = '''
-ovirt_permissions:
- description: "List of dictionaries describing the permissions. Permission attributes are mapped to dictionary keys,
- all permissions attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/permission."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-try:
- import ovirtsdk4 as sdk
-except ImportError:
- pass
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_link_name,
- ovirt_info_full_argument_spec,
- search_by_name,
-)
-
-
-def _permissions_service(connection, module):
- if module.params['user_name']:
- service = connection.system_service().users_service()
- entity = next(
- iter(
- service.list(
- search='usrname={0}'.format(
- '{0}@{1}'.format(module.params['user_name'], module.params['authz_name'])
- )
- )
- ),
- None
- )
- else:
- service = connection.system_service().groups_service()
- entity = search_by_name(service, module.params['group_name'])
-
- if entity is None:
- raise Exception("User/Group wasn't found.")
-
- return service.service(entity.id).permissions_service()
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- authz_name=dict(required=True, aliases=['domain']),
- user_name=dict(default=None),
- group_name=dict(default=None),
- namespace=dict(default=None),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_permission_facts', 'community.general.ovirt_permission_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_permission_facts' module has been renamed to 'ovirt_permission_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- permissions_service = _permissions_service(connection, module)
- permissions = []
- for p in permissions_service.list():
- newperm = dict()
- for key, value in p.__dict__.items():
- if value and isinstance(value, sdk.Struct):
- newperm[key[1:]] = get_link_name(connection, value)
- newperm['%s_id' % key[1:]] = value.id
- permissions.append(newperm)
-
- result = dict(ovirt_permissions=permissions)
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_quota_facts.py b/plugins/modules/cloud/ovirt/ovirt_quota_facts.py
deleted file mode 100644
index b2424305ae..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_quota_facts.py
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_quota_facts
-short_description: Retrieve information about one or more oVirt/RHV quotas
-author: "Maor Lipchuk (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_quota_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV quotas."
-notes:
- - "This module returns a variable C(ovirt_quotas), which
- contains a list of quotas. You need to register the result with
- the I(register) keyword to use it."
-options:
- data_center:
- description:
- - "Name of the datacenter where quota resides."
- required: true
- name:
- description:
- - "Name of the quota, can be used as glob expression."
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about quota named C in Default datacenter
- ovirt_quota_info:
- data_center: Default
- name: myquota
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_quotas }}"
-'''
-
-RETURN = '''
-ovirt_quotas:
- description: "List of dictionaries describing the quotas. Quota attributes are mapped to dictionary keys,
- all quotas attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/quota."
- returned: On success.
- type: list
-'''
-
-import fnmatch
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
- search_by_name,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- data_center=dict(required=True),
- name=dict(default=None),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_quota_facts', 'community.general.ovirt_quota_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_quota_facts' module has been renamed to 'ovirt_quota_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- datacenters_service = connection.system_service().data_centers_service()
- dc_name = module.params['data_center']
- dc = search_by_name(datacenters_service, dc_name)
- if dc is None:
- raise Exception("Datacenter '%s' was not found." % dc_name)
-
- quotas_service = datacenters_service.service(dc.id).quotas_service()
- if module.params['name']:
- quotas = [
- e for e in quotas_service.list()
- if fnmatch.fnmatch(e.name, module.params['name'])
- ]
- else:
- quotas = quotas_service.list()
-
- result = dict(
- ovirt_quotas=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in quotas
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py b/plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py
deleted file mode 100644
index eeaeb61051..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py
+++ /dev/null
@@ -1,140 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright (c) 2017 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_scheduling_policy_facts
-short_description: Retrieve information about one or more oVirt scheduling policies
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_scheduling_policy_info) instead.
-description:
- - "Retrieve information about one or more oVirt scheduling policies."
-notes:
- - "This module returns a variable C(ovirt_scheduling_policies),
- which contains a list of scheduling policies. You need to register the result with
- the I(register) keyword to use it."
-options:
- id:
- description:
- - "ID of the scheduling policy."
- name:
- description:
- - "Name of the scheduling policy, can be used as glob expression."
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all scheduling policies with name InClusterUpgrade
- ovirt_scheduling_policy_info:
- name: InClusterUpgrade
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_scheduling_policies }}"
-'''
-
-RETURN = '''
-ovirt_scheduling_policies:
- description: "List of dictionaries describing the scheduling policies.
- Scheduling policies attributes are mapped to dictionary keys,
- all scheduling policies attributes can be found at following
- url: https://ovirt.example.com/ovirt-engine/api/model#types/scheduling_policy."
- returned: On success.
- type: list
-'''
-
-import fnmatch
-import traceback
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- id=dict(default=None),
- name=dict(default=None),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_scheduling_policy_facts', 'community.general.ovirt_scheduling_policy_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_scheduling_policy_facts' module has been renamed to 'ovirt_scheduling_policy_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- system_service = connection.system_service()
- sched_policies_service = system_service.scheduling_policies_service()
- if module.params['name']:
- sched_policies = [
- e for e in sched_policies_service.list()
- if fnmatch.fnmatch(e.name, module.params['name'])
- ]
- elif module.params['id']:
- sched_policies = [
- sched_policies_service.service(module.params['id']).get()
- ]
- else:
- sched_policies = sched_policies_service.list()
-
- result = dict(
- ovirt_scheduling_policies=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in sched_policies
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py b/plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py
deleted file mode 100644
index 737468835e..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/usr/bin/python
-# -*- 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
-
-DOCUMENTATION = '''
----
-module: ovirt_snapshot_facts
-short_description: Retrieve information about one or more oVirt/RHV virtual machine snapshots
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_snapshot_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV virtual machine snapshots."
-notes:
- - "This module returns a variable C(ovirt_snapshots), which
- contains a list of snapshots. You need to register the result with
- the I(register) keyword to use it."
-options:
- vm:
- description:
- - "Name of the VM with snapshot."
- required: true
- description:
- description:
- - "Description of the snapshot, can be used as glob expression."
- snapshot_id:
- description:
- - "Id of the snapshot we want to retrieve information about."
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all snapshots which description start with update for VM named centos7
- ovirt_snapshot_info:
- vm: centos7
- description: update*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_snapshots }}"
-'''
-
-RETURN = '''
-ovirt_snapshots:
- description: "List of dictionaries describing the snapshot. Snapshot attributes are mapped to dictionary keys,
- all snapshot attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/snapshot."
- returned: On success.
- type: list
-'''
-
-
-import fnmatch
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
- search_by_name,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- vm=dict(required=True),
- description=dict(default=None),
- snapshot_id=dict(default=None),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_snapshot_facts', 'community.general.ovirt_snapshot_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_snapshot_facts' module has been renamed to 'ovirt_snapshot_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- vms_service = connection.system_service().vms_service()
- vm_name = module.params['vm']
- vm = search_by_name(vms_service, vm_name)
- if vm is None:
- raise Exception("VM '%s' was not found." % vm_name)
-
- snapshots_service = vms_service.service(vm.id).snapshots_service()
- if module.params['description']:
- snapshots = [
- e for e in snapshots_service.list()
- if fnmatch.fnmatch(e.description, module.params['description'])
- ]
- elif module.params['snapshot_id']:
- snapshots = [
- snapshots_service.snapshot_service(module.params['snapshot_id']).get()
- ]
- else:
- snapshots = snapshots_service.list()
-
- result = dict(
- ovirt_snapshots=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in snapshots
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py b/plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py
deleted file mode 100644
index b9d814c121..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_storage_domain_facts
-short_description: Retrieve information about one or more oVirt/RHV storage domains
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_storage_domain_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV storage domains."
-notes:
- - "This module returns a variable C(ovirt_storage_domains), which
- contains a list of storage domains. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search storage domain X from datacenter Y use following pattern:
- name=X and datacenter=Y"
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: >
- Gather information about all storage domains which names
- start with data and belong to data center west
- ovirt_storage_domain_info:
- pattern: name=data* and datacenter=west
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_storage_domains }}"
-'''
-
-RETURN = '''
-ovirt_storage_domains:
- description: "List of dictionaries describing the storage domains. Storage_domain attributes are mapped to dictionary keys,
- all storage domains attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/storage_domain."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_storage_domain_facts', 'community.general.ovirt_storage_domain_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_storage_domain_facts' module has been renamed to 'ovirt_storage_domain_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- storage_domains_service = connection.system_service().storage_domains_service()
- storage_domains = storage_domains_service.list(search=module.params['pattern'])
- result = dict(
- ovirt_storage_domains=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in storage_domains
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py b/plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py
deleted file mode 100644
index 1c58327801..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright (c) 2017 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_storage_template_facts
-short_description: Retrieve information about one or more oVirt/RHV templates relate to a storage domain.
-author: "Maor Lipchuk (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_storage_template_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV templates relate to a storage domain."
-notes:
- - "This module returns a variable C(ovirt_storage_templates), which
- contains a list of templates. You need to register the result with
- the I(register) keyword to use it."
-options:
- unregistered:
- description:
- - "Flag which indicates whether to get unregistered templates which contain one or more
- disks which reside on a storage domain or diskless templates."
- type: bool
- default: false
- max:
- description:
- - "Sets the maximum number of templates to return. If not specified all the templates are returned."
- storage_domain:
- description:
- - "The storage domain name where the templates should be listed."
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all templates which relate to a storage domain and are unregistered
- ovirt_storage_template_info:
- unregistered: yes
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_storage_templates }}"
-'''
-
-RETURN = '''
-ovirt_storage_templates:
- description: "List of dictionaries describing the Templates. Template attributes are mapped to dictionary keys,
- all Templates attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/template."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
- get_id_by_name
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- storage_domain=dict(default=None),
- max=dict(default=None, type='int'),
- unregistered=dict(default=False, type='bool'),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_storage_template_facts', 'community.general.ovirt_storage_template_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_storage_template_facts' module has been renamed to 'ovirt_storage_template_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- storage_domains_service = connection.system_service().storage_domains_service()
- sd_id = get_id_by_name(storage_domains_service, module.params['storage_domain'])
- storage_domain_service = storage_domains_service.storage_domain_service(sd_id)
- templates_service = storage_domain_service.templates_service()
-
- # Find the unregistered Template we want to register:
- if module.params.get('unregistered'):
- templates = templates_service.list(unregistered=True)
- else:
- templates = templates_service.list(max=module.params['max'])
- result = dict(
- ovirt_storage_templates=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in templates
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py b/plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py
deleted file mode 100644
index d024794849..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright (c) 2017 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_storage_vm_facts
-short_description: Retrieve information about one or more oVirt/RHV virtual machines relate to a storage domain.
-author: "Maor Lipchuk (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_storage_vm_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV virtual machines relate to a storage domain."
-notes:
- - "This module returns a variable C(ovirt_storage_vms), which
- contains a list of virtual machines. You need to register the result with
- the I(register) keyword to use it."
-options:
- unregistered:
- description:
- - "Flag which indicates whether to get unregistered virtual machines which contain one or more
- disks which reside on a storage domain or diskless virtual machines."
- type: bool
- default: false
- max:
- description:
- - "Sets the maximum number of virtual machines to return. If not specified all the virtual machines are returned."
- storage_domain:
- description:
- - "The storage domain name where the virtual machines should be listed."
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all VMs which relate to a storage domain and are unregistered
- ovirt_vms_info:
- unregistered: yes
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_storage_vms }}"
-'''
-
-RETURN = '''
-ovirt_storage_vms:
- description: "List of dictionaries describing the VMs. VM attributes are mapped to dictionary keys,
- all VMs attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/vm."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
- get_id_by_name
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- storage_domain=dict(default=None),
- max=dict(default=None, type='int'),
- unregistered=dict(default=False, type='bool'),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_storage_vm_facts', 'community.general.ovirt_storage_vm_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_storage_vm_facts' module has been renamed to 'ovirt_storage_vm_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- storage_domains_service = connection.system_service().storage_domains_service()
- sd_id = get_id_by_name(storage_domains_service, module.params['storage_domain'])
- storage_domain_service = storage_domains_service.storage_domain_service(sd_id)
- vms_service = storage_domain_service.vms_service()
-
- # Find the unregistered VM we want to register:
- if module.params.get('unregistered'):
- vms = vms_service.list(unregistered=True)
- else:
- vms = vms_service.list()
- result = dict(
- ovirt_storage_vms=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in vms
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_tag_facts.py b/plugins/modules/cloud/ovirt/ovirt_tag_facts.py
deleted file mode 100644
index a6ce97dd42..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_tag_facts.py
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_tag_facts
-short_description: Retrieve information about one or more oVirt/RHV tags
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_tag_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV tags."
-notes:
- - "This module returns a variable C(ovirt_tags), which
- contains a list of tags. You need to register the result with
- the I(register) keyword to use it."
-options:
- name:
- description:
- - "Name of the tag which should be listed."
- vm:
- description:
- - "Name of the VM, which tags should be listed."
- host:
- description:
- - "Name of the host, which tags should be listed."
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all tags, which names start with tag
- ovirt_tag_info:
- name: tag*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_tags }}"
-
-- name: Gather information about all tags, which are assigned to VM postgres
- ovirt_tag_info:
- vm: postgres
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_tags }}"
-
-- name: Gather information about all tags, which are assigned to host west
- ovirt_tag_info:
- host: west
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_tags }}"
-'''
-
-RETURN = '''
-ovirt_tags:
- description: "List of dictionaries describing the tags. Tags attributes are mapped to dictionary keys,
- all tags attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/tag."
- returned: On success.
- type: list
-'''
-
-import fnmatch
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
- search_by_name,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- name=dict(default=None),
- host=dict(default=None),
- vm=dict(default=None),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_tag_facts', 'community.general.ovirt_tag_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_tag_facts' module has been renamed to 'ovirt_tag_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- tags_service = connection.system_service().tags_service()
- tags = []
- all_tags = tags_service.list()
- if module.params['name']:
- tags.extend([
- t for t in all_tags
- if fnmatch.fnmatch(t.name, module.params['name'])
- ])
- if module.params['host']:
- hosts_service = connection.system_service().hosts_service()
- host = search_by_name(hosts_service, module.params['host'])
- if host is None:
- raise Exception("Host '%s' was not found." % module.params['host'])
- tags.extend(hosts_service.host_service(host.id).tags_service().list())
- if module.params['vm']:
- vms_service = connection.system_service().vms_service()
- vm = search_by_name(vms_service, module.params['vm'])
- if vm is None:
- raise Exception("Vm '%s' was not found." % module.params['vm'])
- tags.extend(vms_service.vm_service(vm.id).tags_service().list())
-
- if not (module.params['vm'] or module.params['host'] or module.params['name']):
- tags = all_tags
-
- result = dict(
- ovirt_tags=[
- get_dict_of_struct(
- struct=t,
- connection=connection,
- fetch_nested=module.params['fetch_nested'],
- attributes=module.params['nested_attributes'],
- ) for t in tags
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_template_facts.py b/plugins/modules/cloud/ovirt/ovirt_template_facts.py
deleted file mode 100644
index 7595c64afa..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_template_facts.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_template_facts
-short_description: Retrieve information about one or more oVirt/RHV templates
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_template_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV templates."
-notes:
- - "This module returns a variable C(ovirt_templates), which
- contains a list of templates. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search template X from datacenter Y use following pattern:
- name=X and datacenter=Y"
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all templates which names start with centos and belongs to data center west
- ovirt_template_info:
- pattern: name=centos* and datacenter=west
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_templates }}"
-'''
-
-RETURN = '''
-ovirt_templates:
- description: "List of dictionaries describing the templates. Template attributes are mapped to dictionary keys,
- all templates attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/template."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_template_facts', 'community.general.ovirt_template_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_template_facts' module has been renamed to 'ovirt_template_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- templates_service = connection.system_service().templates_service()
- templates = templates_service.list(search=module.params['pattern'])
- result = dict(
- ovirt_templates=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in templates
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_user_facts.py b/plugins/modules/cloud/ovirt/ovirt_user_facts.py
deleted file mode 100644
index ce7ab8d661..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_user_facts.py
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_user_facts
-short_description: Retrieve information about one or more oVirt/RHV users
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_user_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV users."
-notes:
- - "This module returns a variable C(ovirt_users), which
- contains a list of users. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search user X use following pattern: name=X"
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all users which first names start with john
- ovirt_user_info:
- pattern: name=john*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_users }}"
-'''
-
-RETURN = '''
-ovirt_users:
- description: "List of dictionaries describing the users. User attributes are mapped to dictionary keys,
- all users attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/user."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_user_facts', 'community.general.ovirt_user_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_user_facts' module has been renamed to 'ovirt_user_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- users_service = connection.system_service().users_service()
- users = users_service.list(search=module.params['pattern'])
- result = dict(
- ovirt_users=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in users
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_vm_facts.py b/plugins/modules/cloud/ovirt/ovirt_vm_facts.py
deleted file mode 100644
index a5182755e0..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_vm_facts.py
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_vm_facts
-short_description: Retrieve information about one or more oVirt/RHV virtual machines
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_vm_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV virtual machines."
-notes:
- - "This module returns a variable C(ovirt_vms), which
- contains a list of virtual machines. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search VM X from cluster Y use following pattern:
- name=X and cluster=Y"
- all_content:
- description:
- - "If I(true) all the attributes of the virtual machines should be
- included in the response."
- type: bool
- default: false
- case_sensitive:
- description:
- - "If I(true) performed search will take case into account."
- type: bool
- default: true
- max:
- description:
- - "The maximum number of results to return."
- next_run:
- description:
- - "Indicates if the returned result describes the virtual machine as it is currently running or if describes
- the virtual machine with the modifications that have already been performed but that will only come into
- effect when the virtual machine is restarted. By default the value is set by engine."
- type: bool
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all VMs which names start with centos and belong to cluster west
- ovirt_vm_info:
- pattern: name=centos* and cluster=west
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_vms }}"
-
-- name: Gather info about next run configuration of virtual machine named myvm
- ovirt_vm_info:
- pattern: name=myvm
- next_run: true
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_vms[0] }}"
-'''
-
-RETURN = '''
-ovirt_vms:
- description: "List of dictionaries describing the VMs. VM attributes are mapped to dictionary keys,
- all VMs attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/vm."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- all_content=dict(default=False, type='bool'),
- next_run=dict(default=None, type='bool'),
- case_sensitive=dict(default=True, type='bool'),
- max=dict(default=None, type='int'),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_vm_facts', 'community.general.ovirt_vm_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_vm_facts' module has been renamed to 'ovirt_vm_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- vms_service = connection.system_service().vms_service()
- vms = vms_service.list(
- search=module.params['pattern'],
- all_content=module.params['all_content'],
- case_sensitive=module.params['case_sensitive'],
- max=module.params['max'],
- )
- if module.params['next_run']:
- vms = [vms_service.vm_service(vm.id).get(next_run=True) for vm in vms]
-
- result = dict(
- ovirt_vms=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in vms
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py b/plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py
deleted file mode 100644
index 24842be56c..0000000000
--- a/plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/usr/bin/python
-# -*- 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 .
-#
-
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
-
-DOCUMENTATION = '''
----
-module: ovirt_vmpool_facts
-short_description: Retrieve information about one or more oVirt/RHV vmpools
-author: "Ondra Machacek (@machacekondra)"
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: When migrating to collection we decided to use only _info modules.
- alternative: Use M(ovirt.ovirt.ovirt_vmpool_info) instead.
-description:
- - "Retrieve information about one or more oVirt/RHV vmpools."
-notes:
- - "This module returns a variable C(ovirt_vmpools), which
- contains a list of vmpools. You need to register the result with
- the I(register) keyword to use it."
-options:
- pattern:
- description:
- - "Search term which is accepted by oVirt/RHV search backend."
- - "For example to search vmpool X: name=X"
-extends_documentation_fragment:
-- community.general.ovirt_facts
-
-'''
-
-EXAMPLES = '''
-# Examples don't contain auth parameter for simplicity,
-# look at ovirt_auth module to see how to reuse authentication:
-
-- name: Gather information about all vm pools which names start with centos
- ovirt_vmpool_info:
- pattern: name=centos*
- register: result
-
-- name: Print gathered information
- ansible.builtin.debug:
- msg: "{{ result.ovirt_vm_pools }}"
-'''
-
-RETURN = '''
-ovirt_vm_pools:
- description: "List of dictionaries describing the vmpools. Vm pool attributes are mapped to dictionary keys,
- all vmpools attributes can be found at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/vm_pool."
- returned: On success.
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.common.removed import removed_module
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils._ovirt import (
- check_sdk,
- create_connection,
- get_dict_of_struct,
- ovirt_info_full_argument_spec,
-)
-
-
-def main():
- argument_spec = ovirt_info_full_argument_spec(
- pattern=dict(default='', required=False),
- )
- module = AnsibleModule(argument_spec)
- is_old_facts = module._name in ('ovirt_vmpool_facts', 'community.general.ovirt_vmpool_facts')
- if is_old_facts:
- module.deprecate("The 'ovirt_vmpool_facts' module has been renamed to 'ovirt_vmpool_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- check_sdk(module)
-
- try:
- auth = module.params.pop('auth')
- connection = create_connection(auth)
- vmpools_service = connection.system_service().vm_pools_service()
- vmpools = vmpools_service.list(search=module.params['pattern'])
- result = dict(
- ovirt_vm_pools=[
- get_dict_of_struct(
- struct=c,
- connection=connection,
- fetch_nested=module.params.get('fetch_nested'),
- attributes=module.params.get('nested_attributes'),
- ) for c in vmpools
- ],
- )
- if is_old_facts:
- module.exit_json(changed=False, ansible_facts=result)
- else:
- module.exit_json(changed=False, **result)
- except Exception as e:
- module.fail_json(msg=str(e), exception=traceback.format_exc())
- finally:
- connection.close(logout=auth.get('token') is None)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/scaleway/scaleway_image_facts.py b/plugins/modules/cloud/scaleway/scaleway_image_facts.py
deleted file mode 100644
index 31bbfa76ad..0000000000
--- a/plugins/modules/cloud/scaleway/scaleway_image_facts.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# (c) 2018, Yanis Guenane
-# 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
-
-DOCUMENTATION = r'''
----
-module: scaleway_image_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(community.general.scaleway_image_info) instead.
-short_description: Gather facts about the Scaleway images available.
-description:
- - Gather facts about the Scaleway images available.
-author:
- - "Yanis Guenane (@Spredzy)"
- - "Remy Leone (@sieben)"
-extends_documentation_fragment:
-- community.general.scaleway
-
-
-options:
- region:
- type: str
- description:
- - Scaleway compute zone
- required: true
- choices:
- - ams1
- - EMEA-NL-EVS
- - par1
- - EMEA-FR-PAR1
- - par2
- - EMEA-FR-PAR2
- - waw1
- - EMEA-PL-WAW1
-'''
-
-EXAMPLES = r'''
-- name: Gather Scaleway images facts
- community.general.scaleway_image_facts:
- region: par1
-'''
-
-RETURN = r'''
----
-scaleway_image_facts:
- description: Response from Scaleway API
- returned: success
- type: complex
- sample:
- "scaleway_image_facts": [
- {
- "arch": "x86_64",
- "creation_date": "2018-07-17T16:18:49.276456+00:00",
- "default_bootscript": {
- "architecture": "x86_64",
- "bootcmdargs": "LINUX_COMMON scaleway boot=local nbd.max_part=16",
- "default": false,
- "dtb": "",
- "id": "15fbd2f7-a0f9-412b-8502-6a44da8d98b8",
- "initrd": "http://169.254.42.24/initrd/initrd-Linux-x86_64-v3.14.5.gz",
- "kernel": "http://169.254.42.24/kernel/x86_64-mainline-lts-4.9-4.9.93-rev1/vmlinuz-4.9.93",
- "organization": "11111111-1111-4111-8111-111111111111",
- "public": true,
- "title": "x86_64 mainline 4.9.93 rev1"
- },
- "extra_volumes": [],
- "from_server": null,
- "id": "00ae4a88-3252-4eda-9feb-5f6b56bf5ef0",
- "modification_date": "2018-07-17T16:42:06.319315+00:00",
- "name": "Debian Stretch",
- "organization": "51b656e3-4865-41e8-adbc-0c45bdd780db",
- "public": true,
- "root_volume": {
- "id": "da32dfbb-c5ff-476d-ae2d-c297dd09b7dd",
- "name": "snapshot-2a7229dc-d431-4dc5-b66e-95db08b773af-2018-07-17_16:18",
- "size": 25000000000,
- "volume_type": "l_ssd"
- },
- "state": "available"
- }
- ]
-'''
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils.scaleway import (
- Scaleway, ScalewayException, scaleway_argument_spec, SCALEWAY_LOCATION)
-
-
-class ScalewayImageFacts(Scaleway):
-
- def __init__(self, module):
- super(ScalewayImageFacts, self).__init__(module)
- self.name = 'images'
-
- region = module.params["region"]
- self.module.params['api_url'] = SCALEWAY_LOCATION[region]["api_endpoint"]
-
-
-def main():
- argument_spec = scaleway_argument_spec()
- argument_spec.update(dict(
- region=dict(required=True, choices=list(SCALEWAY_LOCATION.keys())),
- ))
- module = AnsibleModule(
- argument_spec=argument_spec,
- supports_check_mode=True,
- )
-
- try:
- module.exit_json(
- ansible_facts={'scaleway_image_facts': ScalewayImageFacts(module).get_resources()}
- )
- except ScalewayException as exc:
- module.fail_json(msg=exc.message)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/scaleway/scaleway_ip_facts.py b/plugins/modules/cloud/scaleway/scaleway_ip_facts.py
deleted file mode 100644
index 4227f36067..0000000000
--- a/plugins/modules/cloud/scaleway/scaleway_ip_facts.py
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# (c) 2018, Yanis Guenane
-# 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
-
-DOCUMENTATION = r'''
----
-module: scaleway_ip_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(community.general.scaleway_ip_info) instead.
-short_description: Gather facts about the Scaleway ips available.
-description:
- - Gather facts about the Scaleway ips available.
-author:
- - "Yanis Guenane (@Spredzy)"
- - "Remy Leone (@sieben)"
-extends_documentation_fragment:
-- community.general.scaleway
-
-options:
- region:
- type: str
- description:
- - Scaleway region to use (for example par1).
- required: true
- choices:
- - ams1
- - EMEA-NL-EVS
- - par1
- - EMEA-FR-PAR1
- - par2
- - EMEA-FR-PAR2
- - waw1
- - EMEA-PL-WAW1
-'''
-
-EXAMPLES = r'''
-- name: Gather Scaleway ips facts
- community.general.scaleway_ip_facts:
- region: par1
-'''
-
-RETURN = r'''
----
-scaleway_ip_facts:
- description: Response from Scaleway API
- returned: success
- type: complex
- sample:
- "scaleway_ip_facts": [
- {
- "address": "163.172.170.243",
- "id": "ea081794-a581-8899-8451-386ddaf0a451",
- "organization": "3f709602-5e6c-4619-b80c-e324324324af",
- "reverse": null,
- "server": {
- "id": "12f19bc7-109c-4517-954c-e6b3d0311363",
- "name": "scw-e0d158"
- }
- }
- ]
-'''
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils.scaleway import (
- Scaleway,
- ScalewayException,
- scaleway_argument_spec,
- SCALEWAY_LOCATION,
-)
-
-
-class ScalewayIpFacts(Scaleway):
-
- def __init__(self, module):
- super(ScalewayIpFacts, self).__init__(module)
- self.name = 'ips'
-
- region = module.params["region"]
- self.module.params['api_url'] = SCALEWAY_LOCATION[region]["api_endpoint"]
-
-
-def main():
- argument_spec = scaleway_argument_spec()
- argument_spec.update(dict(
- region=dict(required=True, choices=list(SCALEWAY_LOCATION.keys())),
- ))
- module = AnsibleModule(
- argument_spec=argument_spec,
- supports_check_mode=True,
- )
-
- try:
- module.exit_json(
- ansible_facts={'scaleway_ip_facts': ScalewayIpFacts(module).get_resources()}
- )
- except ScalewayException as exc:
- module.fail_json(msg=exc.message)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/scaleway/scaleway_organization_facts.py b/plugins/modules/cloud/scaleway/scaleway_organization_facts.py
deleted file mode 100644
index ee571cdc1f..0000000000
--- a/plugins/modules/cloud/scaleway/scaleway_organization_facts.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# (c) 2018, Yanis Guenane
-# 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
-
-DOCUMENTATION = r'''
----
-module: scaleway_organization_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(community.general.scaleway_organization_info) instead.
-short_description: Gather facts about the Scaleway organizations available.
-description:
- - Gather facts about the Scaleway organizations available.
-author:
- - "Yanis Guenane (@Spredzy)"
- - "Remy Leone (@sieben)"
-options:
- api_url:
- description:
- - Scaleway API URL
- default: 'https://account.scaleway.com'
- aliases: ['base_url']
-extends_documentation_fragment:
-- community.general.scaleway
-
-'''
-
-EXAMPLES = r'''
-- name: Gather Scaleway organizations facts
- community.general.scaleway_organization_facts:
-'''
-
-RETURN = r'''
----
-scaleway_organization_facts:
- description: Response from Scaleway API
- returned: success
- type: complex
- sample:
- "scaleway_organization_facts": [
- {
- "address_city_name": "Paris",
- "address_country_code": "FR",
- "address_line1": "42 Rue de l'univers",
- "address_line2": null,
- "address_postal_code": "75042",
- "address_subdivision_code": "FR-75",
- "creation_date": "2018-08-06T13:43:28.508575+00:00",
- "currency": "EUR",
- "customer_class": "individual",
- "id": "3f709602-5e6c-4619-b80c-e8432ferewtr",
- "locale": "fr_FR",
- "modification_date": "2018-08-06T14:56:41.401685+00:00",
- "name": "James Bond",
- "support_id": "694324",
- "support_level": "basic",
- "support_pin": "9324",
- "users": [],
- "vat_number": null,
- "warnings": []
- }
- ]
-'''
-
-from ansible.module_utils.basic import AnsibleModule, env_fallback
-from ansible_collections.community.general.plugins.module_utils.scaleway import (
- Scaleway, ScalewayException, scaleway_argument_spec
-)
-
-
-class ScalewayOrganizationFacts(Scaleway):
-
- def __init__(self, module):
- super(ScalewayOrganizationFacts, self).__init__(module)
- self.name = 'organizations'
-
-
-def main():
- argument_spec = scaleway_argument_spec()
- argument_spec.update(dict(
- api_url=dict(fallback=(env_fallback, ['SCW_API_URL']), default='https://account.scaleway.com', aliases=['base_url']),
- ))
-
- module = AnsibleModule(
- argument_spec=argument_spec,
- supports_check_mode=True,
- )
-
- try:
- module.exit_json(
- ansible_facts={'scaleway_organization_facts': ScalewayOrganizationFacts(module).get_resources()}
- )
- except ScalewayException as exc:
- module.fail_json(msg=exc.message)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/scaleway/scaleway_security_group_facts.py b/plugins/modules/cloud/scaleway/scaleway_security_group_facts.py
deleted file mode 100644
index a43bfedb94..0000000000
--- a/plugins/modules/cloud/scaleway/scaleway_security_group_facts.py
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# (c) 2018, Yanis Guenane
-# 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
-
-DOCUMENTATION = r'''
----
-module: scaleway_security_group_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(community.general.scaleway_security_group_info) instead.
-short_description: Gather facts about the Scaleway security groups available.
-description:
- - Gather facts about the Scaleway security groups available.
-author:
- - "Yanis Guenane (@Spredzy)"
- - "Remy Leone (@sieben)"
-options:
- region:
- type: str
- description:
- - Scaleway region to use (for example par1).
- required: true
- choices:
- - ams1
- - EMEA-NL-EVS
- - par1
- - EMEA-FR-PAR1
- - par2
- - EMEA-FR-PAR2
- - waw1
- - EMEA-PL-WAW1
-extends_documentation_fragment:
-- community.general.scaleway
-
-'''
-
-EXAMPLES = r'''
-- name: Gather Scaleway security groups facts
- community.general.scaleway_security_group_facts:
- region: par1
-'''
-
-RETURN = r'''
----
-scaleway_security_group_facts:
- description: Response from Scaleway API
- returned: success
- type: complex
- sample:
- "scaleway_security_group_facts": [
- {
- "description": "test-ams",
- "enable_default_security": true,
- "id": "7fcde327-8bed-43a6-95c4-6dfbc56d8b51",
- "name": "test-ams",
- "organization": "3f709602-5e6c-4619-b80c-e841c89734af",
- "organization_default": false,
- "servers": [
- {
- "id": "12f19bc7-108c-4517-954c-e6b3d0311363",
- "name": "scw-e0d158"
- }
- ]
- }
- ]
-'''
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils.scaleway import (
- Scaleway,
- ScalewayException,
- scaleway_argument_spec,
- SCALEWAY_LOCATION,
-)
-
-
-class ScalewaySecurityGroupFacts(Scaleway):
-
- def __init__(self, module):
- super(ScalewaySecurityGroupFacts, self).__init__(module)
- self.name = 'security_groups'
-
- region = module.params["region"]
- self.module.params['api_url'] = SCALEWAY_LOCATION[region]["api_endpoint"]
-
-
-def main():
- argument_spec = scaleway_argument_spec()
- argument_spec.update(dict(
- region=dict(required=True, choices=list(SCALEWAY_LOCATION.keys())),
- ))
- module = AnsibleModule(
- argument_spec=argument_spec,
- supports_check_mode=True,
- )
-
- try:
- module.exit_json(
- ansible_facts={'scaleway_security_group_facts': ScalewaySecurityGroupFacts(module).get_resources()}
- )
- except ScalewayException as exc:
- module.fail_json(msg=exc.message)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/scaleway/scaleway_server_facts.py b/plugins/modules/cloud/scaleway/scaleway_server_facts.py
deleted file mode 100644
index d3e7366934..0000000000
--- a/plugins/modules/cloud/scaleway/scaleway_server_facts.py
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# (c) 2018, Yanis Guenane
-# 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
-
-DOCUMENTATION = r'''
----
-module: scaleway_server_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(community.general.scaleway_server_info) instead.
-short_description: Gather facts about the Scaleway servers available.
-description:
- - Gather facts about the Scaleway servers available.
-author:
- - "Yanis Guenane (@Spredzy)"
- - "Remy Leone (@sieben)"
-extends_documentation_fragment:
-- community.general.scaleway
-
-options:
- region:
- type: str
- description:
- - Scaleway region to use (for example par1).
- required: true
- choices:
- - ams1
- - EMEA-NL-EVS
- - par1
- - EMEA-FR-PAR1
- - par2
- - EMEA-FR-PAR2
- - waw1
- - EMEA-PL-WAW1
-'''
-
-EXAMPLES = r'''
-- name: Gather Scaleway servers facts
- community.general.scaleway_server_facts:
- region: par1
-'''
-
-RETURN = r'''
----
-scaleway_server_facts:
- description: Response from Scaleway API
- returned: success
- type: complex
- sample:
- "scaleway_server_facts": [
- {
- "arch": "x86_64",
- "boot_type": "local",
- "bootscript": {
- "architecture": "x86_64",
- "bootcmdargs": "LINUX_COMMON scaleway boot=local nbd.max_part=16",
- "default": true,
- "dtb": "",
- "id": "b1e68c26-a19c-4eac-9222-498b22bd7ad9",
- "initrd": "http://169.254.42.24/initrd/initrd-Linux-x86_64-v3.14.5.gz",
- "kernel": "http://169.254.42.24/kernel/x86_64-mainline-lts-4.4-4.4.127-rev1/vmlinuz-4.4.127",
- "organization": "11111111-1111-4111-8111-111111111111",
- "public": true,
- "title": "x86_64 mainline 4.4.127 rev1"
- },
- "commercial_type": "START1-XS",
- "creation_date": "2018-08-14T21:36:56.271545+00:00",
- "dynamic_ip_required": false,
- "enable_ipv6": false,
- "extra_networks": [],
- "hostname": "scw-e0d256",
- "id": "12f19bc7-108c-4517-954c-e6b3d0311363",
- "image": {
- "arch": "x86_64",
- "creation_date": "2018-04-26T12:42:21.619844+00:00",
- "default_bootscript": {
- "architecture": "x86_64",
- "bootcmdargs": "LINUX_COMMON scaleway boot=local nbd.max_part=16",
- "default": true,
- "dtb": "",
- "id": "b1e68c26-a19c-4eac-9222-498b22bd7ad9",
- "initrd": "http://169.254.42.24/initrd/initrd-Linux-x86_64-v3.14.5.gz",
- "kernel": "http://169.254.42.24/kernel/x86_64-mainline-lts-4.4-4.4.127-rev1/vmlinuz-4.4.127",
- "organization": "11111111-1111-4111-8111-111111111111",
- "public": true,
- "title": "x86_64 mainline 4.4.127 rev1"
- },
- "extra_volumes": [],
- "from_server": null,
- "id": "67375eb1-f14d-4f02-bb42-6119cecbde51",
- "modification_date": "2018-04-26T12:49:07.573004+00:00",
- "name": "Ubuntu Xenial",
- "organization": "51b656e3-4865-41e8-adbc-0c45bdd780db",
- "public": true,
- "root_volume": {
- "id": "020b8d61-3867-4a0e-84a4-445c5393e05d",
- "name": "snapshot-87fc282d-f252-4262-adad-86979d9074cf-2018-04-26_12:42",
- "size": 25000000000,
- "volume_type": "l_ssd"
- },
- "state": "available"
- },
- "ipv6": null,
- "location": {
- "cluster_id": "5",
- "hypervisor_id": "412",
- "node_id": "2",
- "platform_id": "13",
- "zone_id": "par1"
- },
- "maintenances": [],
- "modification_date": "2018-08-14T21:37:28.630882+00:00",
- "name": "scw-e0d256",
- "organization": "3f709602-5e6c-4619-b80c-e841c89734af",
- "private_ip": "10.14.222.131",
- "protected": false,
- "public_ip": {
- "address": "163.172.170.197",
- "dynamic": false,
- "id": "ea081794-a581-4495-8451-386ddaf0a451"
- },
- "security_group": {
- "id": "a37379d2-d8b0-4668-9cfb-1233fc436f7e",
- "name": "Default security group"
- },
- "state": "running",
- "state_detail": "booted",
- "tags": [],
- "volumes": {
- "0": {
- "creation_date": "2018-08-14T21:36:56.271545+00:00",
- "export_uri": "device://dev/vda",
- "id": "68386fae-4f55-4fbf-aabb-953036a85872",
- "modification_date": "2018-08-14T21:36:56.271545+00:00",
- "name": "snapshot-87fc282d-f252-4262-adad-86979d9074cf-2018-04-26_12:42",
- "organization": "3f709602-5e6c-4619-b80c-e841c89734af",
- "server": {
- "id": "12f19bc7-108c-4517-954c-e6b3d0311363",
- "name": "scw-e0d256"
- },
- "size": 25000000000,
- "state": "available",
- "volume_type": "l_ssd"
- }
- }
- }
- ]
-'''
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils.scaleway import (
- Scaleway,
- ScalewayException,
- scaleway_argument_spec,
- SCALEWAY_LOCATION,
-)
-
-
-class ScalewayServerFacts(Scaleway):
-
- def __init__(self, module):
- super(ScalewayServerFacts, self).__init__(module)
- self.name = 'servers'
-
- region = module.params["region"]
- self.module.params['api_url'] = SCALEWAY_LOCATION[region]["api_endpoint"]
-
-
-def main():
- argument_spec = scaleway_argument_spec()
- argument_spec.update(dict(
- region=dict(required=True, choices=list(SCALEWAY_LOCATION.keys())),
- ))
-
- module = AnsibleModule(
- argument_spec=argument_spec,
- supports_check_mode=True,
- )
-
- try:
- module.exit_json(
- ansible_facts={'scaleway_server_facts': ScalewayServerFacts(module).get_resources()}
- )
- except ScalewayException as exc:
- module.fail_json(msg=exc.message)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py b/plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py
deleted file mode 100644
index 25f99e729b..0000000000
--- a/plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# (c) 2018, Yanis Guenane
-# 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
-
-DOCUMENTATION = r'''
----
-module: scaleway_snapshot_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(community.general.scaleway_snapshot_info) instead.
-short_description: Gather facts about the Scaleway snapshots available.
-description:
- - Gather facts about the Scaleway snapshot available.
-author:
- - "Yanis Guenane (@Spredzy)"
- - "Remy Leone (@sieben)"
-extends_documentation_fragment:
-- community.general.scaleway
-
-options:
- region:
- type: str
- description:
- - Scaleway region to use (for example par1).
- required: true
- choices:
- - ams1
- - EMEA-NL-EVS
- - par1
- - EMEA-FR-PAR1
- - par2
- - EMEA-FR-PAR2
- - waw1
- - EMEA-PL-WAW1
-'''
-
-EXAMPLES = r'''
-- name: Gather Scaleway snapshots facts
- community.general.scaleway_snapshot_facts:
- region: par1
-'''
-
-RETURN = r'''
----
-scaleway_snapshot_facts:
- description: Response from Scaleway API
- returned: success
- type: complex
- sample:
- "scaleway_snapshot_facts": [
- {
- "base_volume": {
- "id": "68386fae-4f55-4fbf-aabb-953036a85872",
- "name": "snapshot-87fc282d-f252-4262-adad-86979d9074cf-2018-04-26_12:42"
- },
- "creation_date": "2018-08-14T22:34:35.299461+00:00",
- "id": "b61b4b03-a2e9-4da5-b5ea-e462ac0662d2",
- "modification_date": "2018-08-14T22:34:54.520560+00:00",
- "name": "snapshot-87fc282d-f252-4262-adad-86979d9074cf-2018-04-26_12:42 snapshot",
- "organization": "3f709602-5e6c-4619-b80c-e841c89734af",
- "size": 25000000000,
- "state": "available",
- "volume_type": "l_ssd"
- }
- ]
-'''
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils.scaleway import (
- Scaleway,
- ScalewayException,
- scaleway_argument_spec,
- SCALEWAY_LOCATION
-)
-
-
-class ScalewaySnapshotFacts(Scaleway):
-
- def __init__(self, module):
- super(ScalewaySnapshotFacts, self).__init__(module)
- self.name = 'snapshots'
-
- region = module.params["region"]
- self.module.params['api_url'] = SCALEWAY_LOCATION[region]["api_endpoint"]
-
-
-def main():
- argument_spec = scaleway_argument_spec()
- argument_spec.update(dict(
- region=dict(required=True, choices=list(SCALEWAY_LOCATION.keys())),
- ))
-
- module = AnsibleModule(
- argument_spec=argument_spec,
- supports_check_mode=True,
- )
-
- try:
- module.exit_json(
- ansible_facts={'scaleway_snapshot_facts': ScalewaySnapshotFacts(module).get_resources()}
- )
- except ScalewayException as exc:
- module.fail_json(msg=exc.message)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/scaleway/scaleway_volume_facts.py b/plugins/modules/cloud/scaleway/scaleway_volume_facts.py
deleted file mode 100644
index e894f96548..0000000000
--- a/plugins/modules/cloud/scaleway/scaleway_volume_facts.py
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# (c) 2018, Yanis Guenane
-# 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
-
-DOCUMENTATION = r'''
----
-module: scaleway_volume_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(community.general.scaleway_volume_info) instead.
-short_description: Gather facts about the Scaleway volumes available.
-description:
- - Gather facts about the Scaleway volumes available.
-author:
- - "Yanis Guenane (@Spredzy)"
- - "Remy Leone (@sieben)"
-extends_documentation_fragment:
-- community.general.scaleway
-
-options:
- region:
- type: str
- description:
- - Scaleway region to use (for example par1).
- required: true
- choices:
- - ams1
- - EMEA-NL-EVS
- - par1
- - EMEA-FR-PAR1
- - par2
- - EMEA-FR-PAR2
- - waw1
- - EMEA-PL-WAW1
-'''
-
-EXAMPLES = r'''
-- name: Gather Scaleway volumes facts
- community.general.scaleway_volume_facts:
- region: par1
-'''
-
-RETURN = r'''
----
-scaleway_volume_facts:
- description: Response from Scaleway API
- returned: success
- type: complex
- sample:
- "scaleway_volume_facts": [
- {
- "creation_date": "2018-08-14T20:56:24.949660+00:00",
- "export_uri": null,
- "id": "b8d51a06-daeb-4fef-9539-a8aea016c1ba",
- "modification_date": "2018-08-14T20:56:24.949660+00:00",
- "name": "test-volume",
- "organization": "3f709602-5e6c-4619-b80c-e841c89734af",
- "server": null,
- "size": 50000000000,
- "state": "available",
- "volume_type": "l_ssd"
- }
- ]
-'''
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils.scaleway import (
- Scaleway, ScalewayException, scaleway_argument_spec,
- SCALEWAY_LOCATION)
-
-
-class ScalewayVolumeFacts(Scaleway):
-
- def __init__(self, module):
- super(ScalewayVolumeFacts, self).__init__(module)
- self.name = 'volumes'
-
- region = module.params["region"]
- self.module.params['api_url'] = SCALEWAY_LOCATION[region]["api_endpoint"]
-
-
-def main():
- argument_spec = scaleway_argument_spec()
- argument_spec.update(dict(
- region=dict(required=True, choices=list(SCALEWAY_LOCATION.keys())),
- ))
-
- module = AnsibleModule(
- argument_spec=argument_spec,
- supports_check_mode=True,
- )
-
- try:
- module.exit_json(
- ansible_facts={'scaleway_volume_facts': ScalewayVolumeFacts(module).get_resources()}
- )
- except ScalewayException as exc:
- module.fail_json(msg=exc.message)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/cloud/smartos/smartos_image_facts.py b/plugins/modules/cloud/smartos/smartos_image_facts.py
deleted file mode 120000
index d7206ed938..0000000000
--- a/plugins/modules/cloud/smartos/smartos_image_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-smartos_image_info.py
\ No newline at end of file
diff --git a/plugins/modules/cloud/smartos/smartos_image_info.py b/plugins/modules/cloud/smartos/smartos_image_info.py
index 45d8e34085..f1c75bc26c 100644
--- a/plugins/modules/cloud/smartos/smartos_image_info.py
+++ b/plugins/modules/cloud/smartos/smartos_image_info.py
@@ -47,9 +47,6 @@ EXAMPLES = '''
has {{ result.smartos_images[item]['clones'] }} VM(s)"
with_items: "{{ result.smartos_images.keys() | list }}"
-# When the module is called as smartos_image_facts, return values are published
-# in ansible_facts['smartos_images'] and can be used as follows.
-# Note that this is deprecated and will stop working in community.general 3.0.0.
- name: Print information
ansible.builtin.debug:
msg: "{{ smartos_images[item]['name'] }}-{{ smartos_images[item]['version'] }}
@@ -102,20 +99,12 @@ def main():
),
supports_check_mode=False,
)
- is_old_facts = module._name in ('smartos_image_facts', 'community.general.smartos_image_facts')
- if is_old_facts:
- module.deprecate("The 'smartos_image_facts' module has been renamed to 'smartos_image_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
image_facts = ImageFacts(module)
data = dict(smartos_images=image_facts.return_all_installed_images())
- if is_old_facts:
- module.exit_json(ansible_facts=data)
- else:
- module.exit_json(**data)
+ module.exit_json(**data)
if __name__ == '__main__':
diff --git a/plugins/modules/cloud/xenserver/xenserver_guest_facts.py b/plugins/modules/cloud/xenserver/xenserver_guest_facts.py
deleted file mode 120000
index e4f2c814ea..0000000000
--- a/plugins/modules/cloud/xenserver/xenserver_guest_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-xenserver_guest_info.py
\ No newline at end of file
diff --git a/plugins/modules/cloud/xenserver/xenserver_guest_info.py b/plugins/modules/cloud/xenserver/xenserver_guest_info.py
index d3260b6e73..a2e777253e 100644
--- a/plugins/modules/cloud/xenserver/xenserver_guest_info.py
+++ b/plugins/modules/cloud/xenserver/xenserver_guest_info.py
@@ -204,10 +204,6 @@ def main():
],
)
- if module._name in ('xenserver_guest_facts', 'community.general.xenserver_guest_facts'):
- module.deprecate("The 'xenserver_guest_facts' module has been renamed to 'xenserver_guest_info'",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
result = {'failed': False, 'changed': False}
# Module will exit with an error message if no VM is found.
diff --git a/plugins/modules/database/vertica/vertica_facts.py b/plugins/modules/database/vertica/vertica_facts.py
deleted file mode 120000
index bf964af0ae..0000000000
--- a/plugins/modules/database/vertica/vertica_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-vertica_info.py
\ No newline at end of file
diff --git a/plugins/modules/database/vertica/vertica_info.py b/plugins/modules/database/vertica/vertica_info.py
index ace130b89d..c0aa94be1e 100644
--- a/plugins/modules/database/vertica/vertica_info.py
+++ b/plugins/modules/database/vertica/vertica_info.py
@@ -233,11 +233,6 @@ def main():
login_user=dict(default='dbadmin'),
login_password=dict(default=None, no_log=True),
), supports_check_mode=True)
- is_old_facts = module._name in ('vertica_facts', 'community.general.vertica_facts')
- if is_old_facts:
- module.deprecate("The 'vertica_facts' module has been renamed to 'vertica_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
if not pyodbc_found:
module.fail_json(msg=missing_required_lib('pyodbc'), exception=PYODBC_IMP_ERR)
@@ -269,20 +264,12 @@ def main():
configuration_facts = get_configuration_facts(cursor)
node_facts = get_node_facts(cursor)
- if is_old_facts:
- module.exit_json(changed=False,
- ansible_facts={'vertica_schemas': schema_facts,
- 'vertica_users': user_facts,
- 'vertica_roles': role_facts,
- 'vertica_configuration': configuration_facts,
- 'vertica_nodes': node_facts})
- else:
- module.exit_json(changed=False,
- vertica_schemas=schema_facts,
- vertica_users=user_facts,
- vertica_roles=role_facts,
- vertica_configuration=configuration_facts,
- vertica_nodes=node_facts)
+ module.exit_json(changed=False,
+ vertica_schemas=schema_facts,
+ vertica_users=user_facts,
+ vertica_roles=role_facts,
+ vertica_configuration=configuration_facts,
+ vertica_nodes=node_facts)
except NotSupportedError as e:
module.fail_json(msg=to_native(e), exception=traceback.format_exc())
except SystemExit:
diff --git a/plugins/modules/gluster_heal_info.py b/plugins/modules/gluster_heal_info.py
deleted file mode 120000
index 7db0a47d9c..0000000000
--- a/plugins/modules/gluster_heal_info.py
+++ /dev/null
@@ -1 +0,0 @@
-./storage/glusterfs/gluster_heal_info.py
\ No newline at end of file
diff --git a/plugins/modules/gluster_peer.py b/plugins/modules/gluster_peer.py
deleted file mode 120000
index a54980c8b8..0000000000
--- a/plugins/modules/gluster_peer.py
+++ /dev/null
@@ -1 +0,0 @@
-./storage/glusterfs/gluster_peer.py
\ No newline at end of file
diff --git a/plugins/modules/gluster_volume.py b/plugins/modules/gluster_volume.py
deleted file mode 120000
index 3e9f5c1b6c..0000000000
--- a/plugins/modules/gluster_volume.py
+++ /dev/null
@@ -1 +0,0 @@
-./storage/glusterfs/gluster_volume.py
\ No newline at end of file
diff --git a/plugins/modules/helm.py b/plugins/modules/helm.py
deleted file mode 120000
index b0554c73cf..0000000000
--- a/plugins/modules/helm.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/misc/helm.py
\ No newline at end of file
diff --git a/plugins/modules/hpilo_facts.py b/plugins/modules/hpilo_facts.py
deleted file mode 120000
index 966a95c5e5..0000000000
--- a/plugins/modules/hpilo_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/hpilo/hpilo_facts.py
\ No newline at end of file
diff --git a/plugins/modules/identity/onepassword_facts.py b/plugins/modules/identity/onepassword_facts.py
deleted file mode 120000
index 4e4c2b117c..0000000000
--- a/plugins/modules/identity/onepassword_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-onepassword_info.py
\ No newline at end of file
diff --git a/plugins/modules/identity/onepassword_info.py b/plugins/modules/identity/onepassword_info.py
index a085331e7d..42a6311c0d 100644
--- a/plugins/modules/identity/onepassword_info.py
+++ b/plugins/modules/identity/onepassword_info.py
@@ -20,9 +20,6 @@ requirements:
notes:
- Tested with C(op) version 0.5.5
- "Based on the C(onepassword) lookup plugin by Scott Buchanan ."
- - When this module is called with the deprecated C(onepassword_facts) name, potentially sensitive data
- from 1Password is returned as Ansible facts. Facts are subject to caching if enabled, which means this
- data could be stored in clear text on disk or in a database.
short_description: Gather items from 1Password
description:
- M(community.general.onepassword_info) wraps the C(op) command line utility to fetch data about one or more 1Password items.
@@ -380,13 +377,7 @@ def main():
results = {'onepassword': OnePasswordInfo().run()}
- if module._name in ('onepassword_facts', 'community.general.onepassword_facts'):
- module.deprecate("The 'onepassword_facts' module has been renamed to 'onepassword_info'. "
- "When called with the new name it no longer returns 'ansible_facts'",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
- module.exit_json(changed=False, ansible_facts=results)
- else:
- module.exit_json(changed=False, **results)
+ module.exit_json(changed=False, **results)
if __name__ == '__main__':
diff --git a/plugins/modules/idrac_redfish_facts.py b/plugins/modules/idrac_redfish_facts.py
deleted file mode 120000
index 90b0eeef45..0000000000
--- a/plugins/modules/idrac_redfish_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/redfish/idrac_redfish_facts.py
\ No newline at end of file
diff --git a/plugins/modules/jenkins_job_facts.py b/plugins/modules/jenkins_job_facts.py
deleted file mode 120000
index 3a73187dd7..0000000000
--- a/plugins/modules/jenkins_job_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-web_infrastructure/jenkins_job_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ldap_attr.py b/plugins/modules/ldap_attr.py
deleted file mode 120000
index eebbcfd69e..0000000000
--- a/plugins/modules/ldap_attr.py
+++ /dev/null
@@ -1 +0,0 @@
-./net_tools/ldap/ldap_attr.py
\ No newline at end of file
diff --git a/plugins/modules/memset_memstore_facts.py b/plugins/modules/memset_memstore_facts.py
deleted file mode 120000
index 60ab47ac21..0000000000
--- a/plugins/modules/memset_memstore_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-cloud/memset/memset_memstore_facts.py
\ No newline at end of file
diff --git a/plugins/modules/memset_server_facts.py b/plugins/modules/memset_server_facts.py
deleted file mode 120000
index 74e604166c..0000000000
--- a/plugins/modules/memset_server_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-cloud/memset/memset_server_facts.py
\ No newline at end of file
diff --git a/plugins/modules/na_ontap_gather_facts.py b/plugins/modules/na_ontap_gather_facts.py
deleted file mode 120000
index 71f4d1b45f..0000000000
--- a/plugins/modules/na_ontap_gather_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./storage/netapp/na_ontap_gather_facts.py
\ No newline at end of file
diff --git a/plugins/modules/net_tools/ldap/ldap_attr.py b/plugins/modules/net_tools/ldap/ldap_attr.py
deleted file mode 100644
index f983b85745..0000000000
--- a/plugins/modules/net_tools/ldap/ldap_attr.py
+++ /dev/null
@@ -1,284 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-# Copyright: (c) 2016, Peter Sagerson
-# Copyright: (c) 2016, Jiri Tyr
-# 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
-
-DOCUMENTATION = r'''
----
-module: ldap_attr
-short_description: Add or remove LDAP attribute values
-description:
- - Add or remove LDAP attribute values.
-notes:
- - This only deals with attributes on existing entries. To add or remove
- whole entries, see M(community.general.ldap_entry).
- - The default authentication settings will attempt to use a SASL EXTERNAL
- bind over a UNIX domain socket. This works well with the default Ubuntu
- install for example, which includes a cn=peercred,cn=external,cn=auth ACL
- rule allowing root to modify the server configuration. If you need to use
- a simple bind to access your server, pass the credentials in I(bind_dn)
- and I(bind_pw).
- - For I(state=present) and I(state=absent), all value comparisons are
- performed on the server for maximum accuracy. For I(state=exact), values
- have to be compared in Python, which obviously ignores LDAP matching
- rules. This should work out in most cases, but it is theoretically
- possible to see spurious changes when target and actual values are
- semantically identical but lexically distinct.
- - "The I(params) parameter was removed due to circumventing Ansible's parameter
- handling. The I(params) parameter started disallowing setting the I(bind_pw) parameter in
- Ansible-2.7 as it was insecure to set the parameter that way."
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.14
- why: 'The current "ldap_attr" module does not support LDAP attribute insertions or deletions with objectClass dependencies.'
- alternative: 'Use M(community.general.ldap_attrs) instead. Deprecated in community.general 0.2.0.'
-author:
- - Jiri Tyr (@jtyr)
-requirements:
- - python-ldap
-options:
- name:
- description:
- - The name of the attribute to modify.
- type: str
- required: true
- state:
- description:
- - The state of the attribute values.
- - If C(present), all given values will be added if they're missing.
- - If C(absent), all given values will be removed if present.
- - If C(exact), the set of values will be forced to exactly those provided and no others.
- - If I(state=exact) and I(value) is an empty list, all values for this attribute will be removed.
- type: str
- choices: [ absent, exact, present ]
- default: present
- values:
- description:
- - The value(s) to add or remove. This can be a string or a list of
- strings. The complex argument format is required in order to pass
- a list of strings (see examples).
- type: raw
- required: true
-extends_documentation_fragment:
-- community.general.ldap.documentation
-
-'''
-
-EXAMPLES = r'''
-- name: Configure directory number 1 for example.com
- community.general.ldap_attr:
- dn: olcDatabase={1}hdb,cn=config
- name: olcSuffix
- values: dc=example,dc=com
- state: exact
-
-# The complex argument format is required here to pass a list of ACL strings.
-- name: Set up the ACL
- community.general.ldap_attr:
- dn: olcDatabase={1}hdb,cn=config
- name: olcAccess
- values:
- - >-
- {0}to attrs=userPassword,shadowLastChange
- by self write
- by anonymous auth
- by dn="cn=admin,dc=example,dc=com" write
- by * none'
- - >-
- {1}to dn.base="dc=example,dc=com"
- by dn="cn=admin,dc=example,dc=com" write
- by * read
- state: exact
-
-- name: Declare some indexes
- community.general.ldap_attr:
- dn: olcDatabase={1}hdb,cn=config
- name: olcDbIndex
- values: "{{ item }}"
- with_items:
- - objectClass eq
- - uid eq
-
-- name: Set up a root user, which we can use later to bootstrap the directory
- community.general.ldap_attr:
- dn: olcDatabase={1}hdb,cn=config
- name: "{{ item.key }}"
- values: "{{ item.value }}"
- state: exact
- with_dict:
- olcRootDN: cn=root,dc=example,dc=com
- olcRootPW: "{SSHA}tabyipcHzhwESzRaGA7oQ/SDoBZQOGND"
-
-- name: Get rid of an unneeded attribute
- community.general.ldap_attr:
- dn: uid=jdoe,ou=people,dc=example,dc=com
- name: shadowExpire
- values: []
- state: exact
- server_uri: ldap://localhost/
- bind_dn: cn=admin,dc=example,dc=com
- bind_pw: password
-
-#
-# The same as in the previous example but with the authentication details
-# stored in the ldap_auth variable:
-#
-# ldap_auth:
-# server_uri: ldap://localhost/
-# bind_dn: cn=admin,dc=example,dc=com
-# bind_pw: password
-#
-# In the example below, 'args' is a task keyword, passed at the same level as the module
-- name: Get rid of an unneeded attribute
- community.general.ldap_attr:
- dn: uid=jdoe,ou=people,dc=example,dc=com
- name: shadowExpire
- values: []
- state: exact
- args: "{{ ldap_auth }}"
-'''
-
-RETURN = r'''
-modlist:
- description: list of modified parameters
- returned: success
- type: list
- sample: '[[2, "olcRootDN", ["cn=root,dc=example,dc=com"]]]'
-'''
-
-import traceback
-
-from ansible.module_utils.basic import AnsibleModule, missing_required_lib
-from ansible.module_utils._text import to_native, to_bytes
-from ansible_collections.community.general.plugins.module_utils.ldap import LdapGeneric, gen_specs
-
-LDAP_IMP_ERR = None
-try:
- import ldap
-
- HAS_LDAP = True
-except ImportError:
- LDAP_IMP_ERR = traceback.format_exc()
- HAS_LDAP = False
-
-
-class LdapAttr(LdapGeneric):
- def __init__(self, module):
- LdapGeneric.__init__(self, module)
-
- # Shortcuts
- self.name = self.module.params['name']
- self.state = self.module.params['state']
-
- # Normalize values
- if isinstance(self.module.params['values'], list):
- self.values = list(map(to_bytes, self.module.params['values']))
- else:
- self.values = [to_bytes(self.module.params['values'])]
-
- def add(self):
- values_to_add = list(filter(self._is_value_absent, self.values))
-
- if len(values_to_add) > 0:
- modlist = [(ldap.MOD_ADD, self.name, values_to_add)]
- else:
- modlist = []
-
- return modlist
-
- def delete(self):
- values_to_delete = list(filter(self._is_value_present, self.values))
-
- if len(values_to_delete) > 0:
- modlist = [(ldap.MOD_DELETE, self.name, values_to_delete)]
- else:
- modlist = []
-
- return modlist
-
- def exact(self):
- try:
- results = self.connection.search_s(
- self.dn, ldap.SCOPE_BASE, attrlist=[self.name])
- except ldap.LDAPError as e:
- self.fail("Cannot search for attribute %s" % self.name, e)
-
- current = results[0][1].get(self.name, [])
- modlist = []
-
- if frozenset(self.values) != frozenset(current):
- if len(current) == 0:
- modlist = [(ldap.MOD_ADD, self.name, self.values)]
- elif len(self.values) == 0:
- modlist = [(ldap.MOD_DELETE, self.name, None)]
- else:
- modlist = [(ldap.MOD_REPLACE, self.name, self.values)]
-
- return modlist
-
- def _is_value_present(self, value):
- """ True if the target attribute has the given value. """
- try:
- is_present = bool(
- self.connection.compare_s(self.dn, self.name, value))
- except ldap.NO_SUCH_ATTRIBUTE:
- is_present = False
-
- return is_present
-
- def _is_value_absent(self, value):
- """ True if the target attribute doesn't have the given value. """
- return not self._is_value_present(value)
-
-
-def main():
- module = AnsibleModule(
- argument_spec=gen_specs(
- name=dict(type='str', required=True),
- params=dict(type='dict'),
- state=dict(type='str', default='present', choices=['absent', 'exact', 'present']),
- values=dict(type='raw', required=True),
- ),
- supports_check_mode=True,
- )
-
- if not HAS_LDAP:
- module.fail_json(msg=missing_required_lib('python-ldap'),
- exception=LDAP_IMP_ERR)
-
- if module.params['params']:
- module.fail_json(msg="The `params` option to ldap_attr was removed in since it circumvents Ansible's option handling")
-
- # Instantiate the LdapAttr object
- ldap = LdapAttr(module)
-
- state = module.params['state']
-
- # Perform action
- if state == 'present':
- modlist = ldap.add()
- elif state == 'absent':
- modlist = ldap.delete()
- elif state == 'exact':
- modlist = ldap.exact()
-
- changed = False
-
- if len(modlist) > 0:
- changed = True
-
- if not module.check_mode:
- try:
- ldap.connection.modify_s(ldap.dn, modlist)
- except Exception as e:
- module.fail_json(msg="Attribute action failed.", details=to_native(e))
-
- module.exit_json(changed=changed, modlist=modlist)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/net_tools/ldap/ldap_entry.py b/plugins/modules/net_tools/ldap/ldap_entry.py
index 7ee0c3ddec..093c49ad50 100644
--- a/plugins/modules/net_tools/ldap/ldap_entry.py
+++ b/plugins/modules/net_tools/ldap/ldap_entry.py
@@ -17,7 +17,7 @@ short_description: Add or remove LDAP entries.
description:
- Add or remove LDAP entries. This module only asserts the existence or
non-existence of an LDAP entry, not its attributes. To assert the
- attribute values of an entry, see M(community.general.ldap_attr).
+ attribute values of an entry, see M(community.general.ldap_attrs).
notes:
- The default authentication settings will attempt to use a SASL EXTERNAL
bind over a UNIX domain socket. This works well with the default Ubuntu
@@ -37,7 +37,7 @@ options:
description:
- If I(state=present), attributes necessary to create an entry. Existing
entries are never modified. To assert specific attribute values on an
- existing entry, use M(community.general.ldap_attr) module instead.
+ existing entry, use M(community.general.ldap_attrs) module instead.
type: dict
objectClass:
description:
@@ -199,7 +199,7 @@ def main():
exception=LDAP_IMP_ERR)
if module.params['params']:
- module.fail_json(msg="The `params` option to ldap_attr was removed since it circumvents Ansible's option handling")
+ module.fail_json(msg="The `params` option to ldap_entry was removed since it circumvents Ansible's option handling")
state = module.params['state']
diff --git a/plugins/modules/nginx_status_facts.py b/plugins/modules/nginx_status_facts.py
deleted file mode 120000
index 40b80e4ccb..0000000000
--- a/plugins/modules/nginx_status_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./web_infrastructure/nginx_status_facts.py
\ No newline at end of file
diff --git a/plugins/modules/one_image_facts.py b/plugins/modules/one_image_facts.py
deleted file mode 120000
index 8466150797..0000000000
--- a/plugins/modules/one_image_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-cloud/opennebula/one_image_facts.py
\ No newline at end of file
diff --git a/plugins/modules/onepassword_facts.py b/plugins/modules/onepassword_facts.py
deleted file mode 120000
index fb2d91a6b0..0000000000
--- a/plugins/modules/onepassword_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-identity/onepassword_facts.py
\ No newline at end of file
diff --git a/plugins/modules/oneview_datacenter_facts.py b/plugins/modules/oneview_datacenter_facts.py
deleted file mode 120000
index 9339da90e3..0000000000
--- a/plugins/modules/oneview_datacenter_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/oneview/oneview_datacenter_facts.py
\ No newline at end of file
diff --git a/plugins/modules/oneview_enclosure_facts.py b/plugins/modules/oneview_enclosure_facts.py
deleted file mode 120000
index 6ecbdf647b..0000000000
--- a/plugins/modules/oneview_enclosure_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/oneview/oneview_enclosure_facts.py
\ No newline at end of file
diff --git a/plugins/modules/oneview_ethernet_network_facts.py b/plugins/modules/oneview_ethernet_network_facts.py
deleted file mode 120000
index cd2fbecc10..0000000000
--- a/plugins/modules/oneview_ethernet_network_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/oneview/oneview_ethernet_network_facts.py
\ No newline at end of file
diff --git a/plugins/modules/oneview_fc_network_facts.py b/plugins/modules/oneview_fc_network_facts.py
deleted file mode 120000
index 29a5b85424..0000000000
--- a/plugins/modules/oneview_fc_network_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/oneview/oneview_fc_network_facts.py
\ No newline at end of file
diff --git a/plugins/modules/oneview_fcoe_network_facts.py b/plugins/modules/oneview_fcoe_network_facts.py
deleted file mode 120000
index 82e76c0eac..0000000000
--- a/plugins/modules/oneview_fcoe_network_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/oneview/oneview_fcoe_network_facts.py
\ No newline at end of file
diff --git a/plugins/modules/oneview_logical_interconnect_group_facts.py b/plugins/modules/oneview_logical_interconnect_group_facts.py
deleted file mode 120000
index 0bd235c44e..0000000000
--- a/plugins/modules/oneview_logical_interconnect_group_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/oneview/oneview_logical_interconnect_group_facts.py
\ No newline at end of file
diff --git a/plugins/modules/oneview_network_set_facts.py b/plugins/modules/oneview_network_set_facts.py
deleted file mode 120000
index c3908dc8c5..0000000000
--- a/plugins/modules/oneview_network_set_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/oneview/oneview_network_set_facts.py
\ No newline at end of file
diff --git a/plugins/modules/oneview_san_manager_facts.py b/plugins/modules/oneview_san_manager_facts.py
deleted file mode 120000
index 5dbf968ec2..0000000000
--- a/plugins/modules/oneview_san_manager_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/oneview/oneview_san_manager_facts.py
\ No newline at end of file
diff --git a/plugins/modules/online_server_facts.py b/plugins/modules/online_server_facts.py
deleted file mode 120000
index 14f853f0df..0000000000
--- a/plugins/modules/online_server_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/online/online_server_facts.py
\ No newline at end of file
diff --git a/plugins/modules/online_user_facts.py b/plugins/modules/online_user_facts.py
deleted file mode 120000
index 9a2c3d4554..0000000000
--- a/plugins/modules/online_user_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/online/online_user_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt.py b/plugins/modules/ovirt.py
deleted file mode 120000
index f216c1e261..0000000000
--- a/plugins/modules/ovirt.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/misc/ovirt.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_affinity_label_facts.py b/plugins/modules/ovirt_affinity_label_facts.py
deleted file mode 120000
index 475d598263..0000000000
--- a/plugins/modules/ovirt_affinity_label_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_affinity_label_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_api_facts.py b/plugins/modules/ovirt_api_facts.py
deleted file mode 120000
index 13e7347b13..0000000000
--- a/plugins/modules/ovirt_api_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_api_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_cluster_facts.py b/plugins/modules/ovirt_cluster_facts.py
deleted file mode 120000
index 435e641fc5..0000000000
--- a/plugins/modules/ovirt_cluster_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_cluster_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_datacenter_facts.py b/plugins/modules/ovirt_datacenter_facts.py
deleted file mode 120000
index 9dabaa5584..0000000000
--- a/plugins/modules/ovirt_datacenter_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_datacenter_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_disk_facts.py b/plugins/modules/ovirt_disk_facts.py
deleted file mode 120000
index 25c83690ab..0000000000
--- a/plugins/modules/ovirt_disk_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_disk_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_event_facts.py b/plugins/modules/ovirt_event_facts.py
deleted file mode 120000
index ef780af7b5..0000000000
--- a/plugins/modules/ovirt_event_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_event_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_external_provider_facts.py b/plugins/modules/ovirt_external_provider_facts.py
deleted file mode 120000
index 1032fdf813..0000000000
--- a/plugins/modules/ovirt_external_provider_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_external_provider_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_group_facts.py b/plugins/modules/ovirt_group_facts.py
deleted file mode 120000
index 8c18fb2093..0000000000
--- a/plugins/modules/ovirt_group_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_group_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_host_facts.py b/plugins/modules/ovirt_host_facts.py
deleted file mode 120000
index 7f5e9fd2fb..0000000000
--- a/plugins/modules/ovirt_host_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_host_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_host_storage_facts.py b/plugins/modules/ovirt_host_storage_facts.py
deleted file mode 120000
index 76c4c589d1..0000000000
--- a/plugins/modules/ovirt_host_storage_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_host_storage_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_network_facts.py b/plugins/modules/ovirt_network_facts.py
deleted file mode 120000
index a1ee16d2fb..0000000000
--- a/plugins/modules/ovirt_network_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_network_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_nic_facts.py b/plugins/modules/ovirt_nic_facts.py
deleted file mode 120000
index f1d06f7145..0000000000
--- a/plugins/modules/ovirt_nic_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_nic_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_permission_facts.py b/plugins/modules/ovirt_permission_facts.py
deleted file mode 120000
index dead73d39d..0000000000
--- a/plugins/modules/ovirt_permission_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_permission_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_quota_facts.py b/plugins/modules/ovirt_quota_facts.py
deleted file mode 120000
index b2ce94e972..0000000000
--- a/plugins/modules/ovirt_quota_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_quota_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_scheduling_policy_facts.py b/plugins/modules/ovirt_scheduling_policy_facts.py
deleted file mode 120000
index 33d453afe6..0000000000
--- a/plugins/modules/ovirt_scheduling_policy_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_scheduling_policy_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_snapshot_facts.py b/plugins/modules/ovirt_snapshot_facts.py
deleted file mode 120000
index d0121c4bd1..0000000000
--- a/plugins/modules/ovirt_snapshot_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_snapshot_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_storage_domain_facts.py b/plugins/modules/ovirt_storage_domain_facts.py
deleted file mode 120000
index 1a077fb571..0000000000
--- a/plugins/modules/ovirt_storage_domain_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_storage_domain_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_storage_template_facts.py b/plugins/modules/ovirt_storage_template_facts.py
deleted file mode 120000
index 968a987ad2..0000000000
--- a/plugins/modules/ovirt_storage_template_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_storage_template_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_storage_vm_facts.py b/plugins/modules/ovirt_storage_vm_facts.py
deleted file mode 120000
index 481e49c860..0000000000
--- a/plugins/modules/ovirt_storage_vm_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_storage_vm_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_tag_facts.py b/plugins/modules/ovirt_tag_facts.py
deleted file mode 120000
index b4e6ccb8ec..0000000000
--- a/plugins/modules/ovirt_tag_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_tag_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_template_facts.py b/plugins/modules/ovirt_template_facts.py
deleted file mode 120000
index c823c91888..0000000000
--- a/plugins/modules/ovirt_template_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_template_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_user_facts.py b/plugins/modules/ovirt_user_facts.py
deleted file mode 120000
index ecfe67d2f8..0000000000
--- a/plugins/modules/ovirt_user_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_user_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_vm_facts.py b/plugins/modules/ovirt_vm_facts.py
deleted file mode 120000
index 03c6bed61a..0000000000
--- a/plugins/modules/ovirt_vm_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_vm_facts.py
\ No newline at end of file
diff --git a/plugins/modules/ovirt_vmpool_facts.py b/plugins/modules/ovirt_vmpool_facts.py
deleted file mode 120000
index 82936451da..0000000000
--- a/plugins/modules/ovirt_vmpool_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/ovirt/ovirt_vmpool_facts.py
\ No newline at end of file
diff --git a/plugins/modules/purefa_facts.py b/plugins/modules/purefa_facts.py
deleted file mode 120000
index f4234d9410..0000000000
--- a/plugins/modules/purefa_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./storage/purestorage/purefa_facts.py
\ No newline at end of file
diff --git a/plugins/modules/purefb_facts.py b/plugins/modules/purefb_facts.py
deleted file mode 120000
index 49975e2332..0000000000
--- a/plugins/modules/purefb_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./storage/purestorage/purefb_facts.py
\ No newline at end of file
diff --git a/plugins/modules/python_requirements_facts.py b/plugins/modules/python_requirements_facts.py
deleted file mode 120000
index 6631804417..0000000000
--- a/plugins/modules/python_requirements_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-system/python_requirements_facts.py
\ No newline at end of file
diff --git a/plugins/modules/redfish_facts.py b/plugins/modules/redfish_facts.py
deleted file mode 120000
index c317efc6c2..0000000000
--- a/plugins/modules/redfish_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-remote_management/redfish/redfish_facts.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/hpilo/hpilo_facts.py b/plugins/modules/remote_management/hpilo/hpilo_facts.py
deleted file mode 120000
index 792c1a7fbc..0000000000
--- a/plugins/modules/remote_management/hpilo/hpilo_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-hpilo_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/hpilo/hpilo_info.py b/plugins/modules/remote_management/hpilo/hpilo_info.py
index af43ca195e..0f204b4a15 100644
--- a/plugins/modules/remote_management/hpilo/hpilo_info.py
+++ b/plugins/modules/remote_management/hpilo/hpilo_info.py
@@ -159,11 +159,6 @@ def main():
),
supports_check_mode=True,
)
- is_old_facts = module._name in ('hpilo_facts', 'community.general.hpilo_facts')
- if is_old_facts:
- module.deprecate("The 'hpilo_facts' module has been renamed to 'hpilo_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
if not HAS_HPILO:
module.fail_json(msg=missing_required_lib('python-hpilo'), exception=HPILO_IMP_ERR)
@@ -248,10 +243,7 @@ def main():
# reformat into a text friendly format
info['hw_memory_total'] = "{0} GB".format(info['hw_memory_total'])
- if is_old_facts:
- module.exit_json(ansible_facts=info)
- else:
- module.exit_json(**info)
+ module.exit_json(**info)
if __name__ == '__main__':
diff --git a/plugins/modules/remote_management/oneview/oneview_datacenter_facts.py b/plugins/modules/remote_management/oneview/oneview_datacenter_facts.py
deleted file mode 120000
index 290e891ee9..0000000000
--- a/plugins/modules/remote_management/oneview/oneview_datacenter_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-oneview_datacenter_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/oneview/oneview_datacenter_info.py b/plugins/modules/remote_management/oneview/oneview_datacenter_info.py
index 35c2e7acf4..13ab883330 100644
--- a/plugins/modules/remote_management/oneview/oneview_datacenter_info.py
+++ b/plugins/modules/remote_management/oneview/oneview_datacenter_info.py
@@ -117,11 +117,6 @@ class DatacenterInfoModule(OneViewModuleBase):
def __init__(self):
super(DatacenterInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
- self.is_old_facts = self.module._name in ('oneview_datacenter_facts', 'community.general.oneview_datacenter_facts')
- if self.is_old_facts:
- self.module.deprecate("The 'oneview_datacenter_facts' module has been renamed to 'oneview_datacenter_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
def execute_module(self):
@@ -141,11 +136,7 @@ class DatacenterInfoModule(OneViewModuleBase):
else:
info['datacenters'] = client.get_all(**self.facts_params)
- if self.is_old_facts:
- return dict(changed=False,
- ansible_facts=info)
- else:
- return dict(changed=False, **info)
+ return dict(changed=False, **info)
def main():
diff --git a/plugins/modules/remote_management/oneview/oneview_enclosure_facts.py b/plugins/modules/remote_management/oneview/oneview_enclosure_facts.py
deleted file mode 120000
index 98e325454c..0000000000
--- a/plugins/modules/remote_management/oneview/oneview_enclosure_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-oneview_enclosure_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/oneview/oneview_enclosure_info.py b/plugins/modules/remote_management/oneview/oneview_enclosure_info.py
index 8ee92c689f..1889dc1a4f 100644
--- a/plugins/modules/remote_management/oneview/oneview_enclosure_info.py
+++ b/plugins/modules/remote_management/oneview/oneview_enclosure_info.py
@@ -164,11 +164,6 @@ class EnclosureInfoModule(OneViewModuleBase):
def __init__(self):
super(EnclosureInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
- self.is_old_facts = self.module._name in ('oneview_enclosure_facts', 'community.general.oneview_enclosure_facts')
- if self.is_old_facts:
- self.module.deprecate("The 'oneview_enclosure_facts' module has been renamed to 'oneview_enclosure_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
def execute_module(self):
@@ -184,11 +179,7 @@ class EnclosureInfoModule(OneViewModuleBase):
info['enclosures'] = enclosures
- if self.is_old_facts:
- return dict(changed=False,
- ansible_facts=info)
- else:
- return dict(changed=False, **info)
+ return dict(changed=False, **info)
def _gather_optional_info(self, options, enclosure):
diff --git a/plugins/modules/remote_management/oneview/oneview_ethernet_network_facts.py b/plugins/modules/remote_management/oneview/oneview_ethernet_network_facts.py
deleted file mode 120000
index b6dd1014c6..0000000000
--- a/plugins/modules/remote_management/oneview/oneview_ethernet_network_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-oneview_ethernet_network_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/oneview/oneview_ethernet_network_info.py b/plugins/modules/remote_management/oneview/oneview_ethernet_network_info.py
index bc8765c352..4021b768f9 100644
--- a/plugins/modules/remote_management/oneview/oneview_ethernet_network_info.py
+++ b/plugins/modules/remote_management/oneview/oneview_ethernet_network_info.py
@@ -115,11 +115,6 @@ class EthernetNetworkInfoModule(OneViewModuleBase):
def __init__(self):
super(EthernetNetworkInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
- self.is_old_facts = self.module._name in ('oneview_ethernet_network_facts', 'community.general.oneview_ethernet_network_facts')
- if self.is_old_facts:
- self.module.deprecate("The 'oneview_ethernet_network_facts' module has been renamed to 'oneview_ethernet_network_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
self.resource_client = self.oneview_client.ethernet_networks
@@ -135,10 +130,7 @@ class EthernetNetworkInfoModule(OneViewModuleBase):
info['ethernet_networks'] = ethernet_networks
- if self.is_old_facts:
- return dict(changed=False, ansible_facts=info)
- else:
- return dict(changed=False, **info)
+ return dict(changed=False, **info)
def __gather_optional_info(self, ethernet_network):
diff --git a/plugins/modules/remote_management/oneview/oneview_fc_network_facts.py b/plugins/modules/remote_management/oneview/oneview_fc_network_facts.py
deleted file mode 120000
index f7739f3bab..0000000000
--- a/plugins/modules/remote_management/oneview/oneview_fc_network_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-oneview_fc_network_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/oneview/oneview_fc_network_info.py b/plugins/modules/remote_management/oneview/oneview_fc_network_info.py
index db48f19f84..21d9673b51 100644
--- a/plugins/modules/remote_management/oneview/oneview_fc_network_info.py
+++ b/plugins/modules/remote_management/oneview/oneview_fc_network_info.py
@@ -84,11 +84,6 @@ class FcNetworkInfoModule(OneViewModuleBase):
)
super(FcNetworkInfoModule, self).__init__(additional_arg_spec=argument_spec)
- self.is_old_facts = self.module._name in ('oneview_fc_network_facts', 'community.general.oneview_fc_network_facts')
- if self.is_old_facts:
- self.module.deprecate("The 'oneview_fc_network_facts' module has been renamed to 'oneview_fc_network_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
def execute_module(self):
@@ -97,10 +92,7 @@ class FcNetworkInfoModule(OneViewModuleBase):
else:
fc_networks = self.oneview_client.fc_networks.get_all(**self.facts_params)
- if self.is_old_facts:
- return dict(changed=False, ansible_facts=dict(fc_networks=fc_networks))
- else:
- return dict(changed=False, fc_networks=fc_networks)
+ return dict(changed=False, fc_networks=fc_networks)
def main():
diff --git a/plugins/modules/remote_management/oneview/oneview_fcoe_network_facts.py b/plugins/modules/remote_management/oneview/oneview_fcoe_network_facts.py
deleted file mode 120000
index 3ff2b0deaa..0000000000
--- a/plugins/modules/remote_management/oneview/oneview_fcoe_network_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-oneview_fcoe_network_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/oneview/oneview_fcoe_network_info.py b/plugins/modules/remote_management/oneview/oneview_fcoe_network_info.py
index e5e1bc08e4..e207670a9a 100644
--- a/plugins/modules/remote_management/oneview/oneview_fcoe_network_info.py
+++ b/plugins/modules/remote_management/oneview/oneview_fcoe_network_info.py
@@ -83,11 +83,6 @@ class FcoeNetworkInfoModule(OneViewModuleBase):
)
super(FcoeNetworkInfoModule, self).__init__(additional_arg_spec=argument_spec)
- self.is_old_facts = self.module._name in ('oneview_fcoe_network_facts', 'community.general.oneview_fcoe_network_facts')
- if self.is_old_facts:
- self.module.deprecate("The 'oneview_fcoe_network_facts' module has been renamed to 'oneview_fcoe_network_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
def execute_module(self):
@@ -96,11 +91,7 @@ class FcoeNetworkInfoModule(OneViewModuleBase):
else:
fcoe_networks = self.oneview_client.fcoe_networks.get_all(**self.facts_params)
- if self.is_old_facts:
- return dict(changed=False,
- ansible_facts=dict(fcoe_networks=fcoe_networks))
- else:
- return dict(changed=False, fcoe_networks=fcoe_networks)
+ return dict(changed=False, fcoe_networks=fcoe_networks)
def main():
diff --git a/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group_facts.py b/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group_facts.py
deleted file mode 120000
index 2539865f5f..0000000000
--- a/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-oneview_logical_interconnect_group_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group_info.py b/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group_info.py
index 3488be92a6..1f7f3c9613 100644
--- a/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group_info.py
+++ b/plugins/modules/remote_management/oneview/oneview_logical_interconnect_group_info.py
@@ -97,11 +97,6 @@ class LogicalInterconnectGroupInfoModule(OneViewModuleBase):
)
super(LogicalInterconnectGroupInfoModule, self).__init__(additional_arg_spec=argument_spec)
- self.is_old_facts = self.module._name in ('oneview_logical_interconnect_group_facts', 'community.general.oneview_logical_interconnect_group_facts')
- if self.is_old_facts:
- self.module.deprecate("The 'oneview_logical_interconnect_group_facts' module has been renamed to 'oneview_logical_interconnect_group_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
def execute_module(self):
if self.module.params.get('name'):
@@ -109,10 +104,7 @@ class LogicalInterconnectGroupInfoModule(OneViewModuleBase):
else:
ligs = self.oneview_client.logical_interconnect_groups.get_all(**self.facts_params)
- if self.is_old_facts:
- return dict(changed=False, ansible_facts=dict(logical_interconnect_groups=ligs))
- else:
- return dict(changed=False, logical_interconnect_groups=ligs)
+ return dict(changed=False, logical_interconnect_groups=ligs)
def main():
diff --git a/plugins/modules/remote_management/oneview/oneview_network_set_facts.py b/plugins/modules/remote_management/oneview/oneview_network_set_facts.py
deleted file mode 120000
index 78f61020d5..0000000000
--- a/plugins/modules/remote_management/oneview/oneview_network_set_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-oneview_network_set_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/oneview/oneview_network_set_info.py b/plugins/modules/remote_management/oneview/oneview_network_set_info.py
index bfc212d40c..bc76cb36b1 100644
--- a/plugins/modules/remote_management/oneview/oneview_network_set_info.py
+++ b/plugins/modules/remote_management/oneview/oneview_network_set_info.py
@@ -136,11 +136,6 @@ class NetworkSetInfoModule(OneViewModuleBase):
def __init__(self):
super(NetworkSetInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
- self.is_old_facts = self.module._name in ('oneview_network_set_facts', 'community.general.oneview_network_set_facts')
- if self.is_old_facts:
- self.module.deprecate("The 'oneview_network_set_facts' module has been renamed to 'oneview_network_set_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
def execute_module(self):
@@ -154,11 +149,7 @@ class NetworkSetInfoModule(OneViewModuleBase):
else:
network_sets = self.oneview_client.network_sets.get_all(**self.facts_params)
- if self.is_old_facts:
- return dict(changed=False,
- ansible_facts=dict(network_sets=network_sets))
- else:
- return dict(changed=False, network_sets=network_sets)
+ return dict(changed=False, network_sets=network_sets)
def main():
diff --git a/plugins/modules/remote_management/oneview/oneview_san_manager_facts.py b/plugins/modules/remote_management/oneview/oneview_san_manager_facts.py
deleted file mode 120000
index d64693b48e..0000000000
--- a/plugins/modules/remote_management/oneview/oneview_san_manager_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-oneview_san_manager_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/oneview/oneview_san_manager_info.py b/plugins/modules/remote_management/oneview/oneview_san_manager_info.py
index 2e462b966d..5dbc28afc2 100644
--- a/plugins/modules/remote_management/oneview/oneview_san_manager_info.py
+++ b/plugins/modules/remote_management/oneview/oneview_san_manager_info.py
@@ -92,11 +92,6 @@ class SanManagerInfoModule(OneViewModuleBase):
def __init__(self):
super(SanManagerInfoModule, self).__init__(additional_arg_spec=self.argument_spec)
self.resource_client = self.oneview_client.san_managers
- self.is_old_facts = self.module._name in ('oneview_san_manager_facts', 'community.general.oneview_san_manager_facts')
- if self.is_old_facts:
- self.module.deprecate("The 'oneview_san_manager_facts' module has been renamed to 'oneview_san_manager_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
def execute_module(self):
if self.module.params.get('provider_display_name'):
@@ -109,10 +104,7 @@ class SanManagerInfoModule(OneViewModuleBase):
else:
resources = self.oneview_client.san_managers.get_all(**self.facts_params)
- if self.is_old_facts:
- return dict(changed=False, ansible_facts=dict(san_managers=resources))
- else:
- return dict(changed=False, san_managers=resources)
+ return dict(changed=False, san_managers=resources)
def main():
diff --git a/plugins/modules/remote_management/redfish/idrac_redfish_facts.py b/plugins/modules/remote_management/redfish/idrac_redfish_facts.py
deleted file mode 120000
index 794ab40206..0000000000
--- a/plugins/modules/remote_management/redfish/idrac_redfish_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-idrac_redfish_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/redfish/idrac_redfish_info.py b/plugins/modules/remote_management/redfish/idrac_redfish_info.py
index 65fbd5a58b..0033db7384 100644
--- a/plugins/modules/remote_management/redfish/idrac_redfish_info.py
+++ b/plugins/modules/remote_management/redfish/idrac_redfish_info.py
@@ -193,11 +193,6 @@ def main():
],
supports_check_mode=False
)
- is_old_facts = module._name in ('idrac_redfish_facts', 'community.general.idrac_redfish_facts')
- if is_old_facts:
- module.deprecate("The 'idrac_redfish_facts' module has been renamed to 'idrac_redfish_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
category = module.params['category']
command_list = module.params['command']
@@ -239,10 +234,7 @@ def main():
# Return data back or fail with proper message
if result['ret'] is True:
del result['ret']
- if is_old_facts:
- module.exit_json(ansible_facts=dict(redfish_facts=result))
- else:
- module.exit_json(redfish_facts=result)
+ module.exit_json(redfish_facts=result)
else:
module.fail_json(msg=to_native(result['msg']))
diff --git a/plugins/modules/remote_management/redfish/redfish_facts.py b/plugins/modules/remote_management/redfish/redfish_facts.py
deleted file mode 120000
index ef039d9a5d..0000000000
--- a/plugins/modules/remote_management/redfish/redfish_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-redfish_info.py
\ No newline at end of file
diff --git a/plugins/modules/remote_management/redfish/redfish_info.py b/plugins/modules/remote_management/redfish/redfish_info.py
index 782115d464..41d5bfb04a 100644
--- a/plugins/modules/remote_management/redfish/redfish_info.py
+++ b/plugins/modules/remote_management/redfish/redfish_info.py
@@ -320,11 +320,6 @@ def main():
],
supports_check_mode=False
)
- is_old_facts = module._name in ('redfish_facts', 'community.general.redfish_facts')
- if is_old_facts:
- module.deprecate("The 'redfish_facts' module has been renamed to 'redfish_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
# admin credentials used for authentication
creds = {'user': module.params['username'],
@@ -472,10 +467,7 @@ def main():
result["health_report"] = rf_utils.get_multi_manager_health_report()
# Return data back
- if is_old_facts:
- module.exit_json(ansible_facts=dict(redfish_facts=result))
- else:
- module.exit_json(redfish_facts=result)
+ module.exit_json(redfish_facts=result)
if __name__ == '__main__':
diff --git a/plugins/modules/scaleway_image_facts.py b/plugins/modules/scaleway_image_facts.py
deleted file mode 120000
index eea032e70a..0000000000
--- a/plugins/modules/scaleway_image_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/scaleway/scaleway_image_facts.py
\ No newline at end of file
diff --git a/plugins/modules/scaleway_ip_facts.py b/plugins/modules/scaleway_ip_facts.py
deleted file mode 120000
index 08fc50d3b9..0000000000
--- a/plugins/modules/scaleway_ip_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/scaleway/scaleway_ip_facts.py
\ No newline at end of file
diff --git a/plugins/modules/scaleway_organization_facts.py b/plugins/modules/scaleway_organization_facts.py
deleted file mode 120000
index 71092e2777..0000000000
--- a/plugins/modules/scaleway_organization_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/scaleway/scaleway_organization_facts.py
\ No newline at end of file
diff --git a/plugins/modules/scaleway_security_group_facts.py b/plugins/modules/scaleway_security_group_facts.py
deleted file mode 120000
index 992b352e94..0000000000
--- a/plugins/modules/scaleway_security_group_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/scaleway/scaleway_security_group_facts.py
\ No newline at end of file
diff --git a/plugins/modules/scaleway_server_facts.py b/plugins/modules/scaleway_server_facts.py
deleted file mode 120000
index e7b44b1f7a..0000000000
--- a/plugins/modules/scaleway_server_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/scaleway/scaleway_server_facts.py
\ No newline at end of file
diff --git a/plugins/modules/scaleway_snapshot_facts.py b/plugins/modules/scaleway_snapshot_facts.py
deleted file mode 120000
index f0ea21055c..0000000000
--- a/plugins/modules/scaleway_snapshot_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/scaleway/scaleway_snapshot_facts.py
\ No newline at end of file
diff --git a/plugins/modules/scaleway_volume_facts.py b/plugins/modules/scaleway_volume_facts.py
deleted file mode 120000
index 9338d01799..0000000000
--- a/plugins/modules/scaleway_volume_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-./cloud/scaleway/scaleway_volume_facts.py
\ No newline at end of file
diff --git a/plugins/modules/smartos_image_facts.py b/plugins/modules/smartos_image_facts.py
deleted file mode 120000
index 5c350d8dc8..0000000000
--- a/plugins/modules/smartos_image_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-cloud/smartos/smartos_image_facts.py
\ No newline at end of file
diff --git a/plugins/modules/source_control/github/github_webhook_info.py b/plugins/modules/source_control/github/github_webhook_info.py
index 0fd0b97bc2..2e7012e631 100644
--- a/plugins/modules/source_control/github/github_webhook_info.py
+++ b/plugins/modules/source_control/github/github_webhook_info.py
@@ -125,9 +125,6 @@ def main():
mutually_exclusive=(('password', 'token'), ),
required_one_of=(("password", "token"), ),
supports_check_mode=True)
- if module._name in ('github_webhook_facts', 'community.general.github_webhook_facts'):
- module.deprecate("The 'github_webhook_facts' module has been renamed to 'github_webhook_info'",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
if not HAS_GITHUB:
module.fail_json(msg=missing_required_lib('PyGithub'),
diff --git a/plugins/modules/storage/glusterfs/gluster_heal_info.py b/plugins/modules/storage/glusterfs/gluster_heal_info.py
deleted file mode 100644
index 1ba16121e0..0000000000
--- a/plugins/modules/storage/glusterfs/gluster_heal_info.py
+++ /dev/null
@@ -1,203 +0,0 @@
-#!/usr/bin/python
-# -*- 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
-
-DOCUMENTATION = '''
----
-module: gluster_heal_info
-short_description: Gather information on self-heal or rebalance status
-deprecated:
- removed_in: 3.0.0
- why: The gluster modules have migrated to the gluster.gluster collection.
- alternative: Use M(gluster.gluster.gluster_heal_info) instead.
-author: "Devyani Kota (@devyanikota)"
-description:
- - Gather facts about either self-heal or rebalance status.
- - This module was called C(gluster_heal_facts) before Ansible 2.9, returning C(ansible_facts).
- Note that the M(community.general.gluster_heal_info) module no longer returns C(ansible_facts)!
-options:
- name:
- description:
- - The volume name.
- required: true
- aliases: ['volume']
- status_filter:
- default: "self-heal"
- choices: ["self-heal", "rebalance"]
- description:
- - Determines which facts are to be returned.
- - If the C(status_filter) is C(self-heal), status of self-heal, along with the number of files still in process are returned.
- - If the C(status_filter) is C(rebalance), rebalance status is returned.
-requirements:
- - GlusterFS > 3.2
-'''
-
-EXAMPLES = '''
-- name: Gather self-heal facts about all gluster hosts in the cluster
- community.general.gluster_heal_info:
- name: test_volume
- status_filter: self-heal
- register: self_heal_status
-- ansible.builtin.debug:
- var: self_heal_status
-
-- name: Gather rebalance facts about all gluster hosts in the cluster
- community.general.gluster_heal_info:
- name: test_volume
- status_filter: rebalance
- register: rebalance_status
-- ansible.builtin.debug:
- var: rebalance_status
-'''
-
-RETURN = '''
-name:
- description: GlusterFS volume name
- returned: always
- type: str
-status_filter:
- description: Whether self-heal or rebalance status is to be returned
- returned: always
- type: str
-heal_info:
- description: List of files that still need healing process
- returned: On success
- type: list
-rebalance_status:
- description: Status of rebalance operation
- returned: On success
- type: list
-'''
-
-import traceback
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils._text import to_native
-from distutils.version import LooseVersion
-
-glusterbin = ''
-
-
-def run_gluster(gargs, **kwargs):
- global glusterbin
- global module
- args = [glusterbin, '--mode=script']
- args.extend(gargs)
- try:
- rc, out, err = module.run_command(args, **kwargs)
- if rc != 0:
- module.fail_json(msg='error running gluster (%s) command (rc=%d): %s' %
- (' '.join(args), rc, out or err), exception=traceback.format_exc())
- except Exception as e:
- module.fail_json(msg='error running gluster (%s) command: %s' % (' '.join(args),
- to_native(e)), exception=traceback.format_exc())
- return out
-
-
-def get_self_heal_status(name):
- out = run_gluster(['volume', 'heal', name, 'info'], environ_update=dict(LANG='C', LC_ALL='C', LC_MESSAGES='C'))
- raw_out = out.split("\n")
- heal_info = []
- # return files that still need healing.
- for line in raw_out:
- if 'Brick' in line:
- br_dict = {}
- br_dict['brick'] = line.strip().strip("Brick")
- elif 'Status' in line:
- br_dict['status'] = line.split(":")[1].strip()
- elif 'Number' in line:
- br_dict['no_of_entries'] = line.split(":")[1].strip()
- elif line.startswith('/') or line.startswith('<') or '\n' in line:
- continue
- else:
- br_dict and heal_info.append(br_dict)
- br_dict = {}
- return heal_info
-
-
-def get_rebalance_status(name):
- out = run_gluster(['volume', 'rebalance', name, 'status'], environ_update=dict(LANG='C', LC_ALL='C', LC_MESSAGES='C'))
- raw_out = out.split("\n")
- rebalance_status = []
- # return the files that are either still 'in progress' state or 'completed'.
- for line in raw_out:
- line = " ".join(line.split())
- line_vals = line.split(" ")
- if line_vals[0].startswith('-') or line_vals[0].startswith('Node'):
- continue
- node_dict = {}
- if len(line_vals) == 1 or len(line_vals) == 4:
- continue
- node_dict['node'] = line_vals[0]
- node_dict['rebalanced_files'] = line_vals[1]
- node_dict['failures'] = line_vals[4]
- if 'in progress' in line:
- node_dict['status'] = line_vals[5] + line_vals[6]
- rebalance_status.append(node_dict)
- elif 'completed' in line:
- node_dict['status'] = line_vals[5]
- rebalance_status.append(node_dict)
- return rebalance_status
-
-
-def is_invalid_gluster_version(module, required_version):
- cmd = module.get_bin_path('gluster', True) + ' --version'
- result = module.run_command(cmd)
- ver_line = result[1].split('\n')[0]
- version = ver_line.split(' ')[1]
- # If the installed version is less than 3.2, it is an invalid version
- # return True
- return LooseVersion(version) < LooseVersion(required_version)
-
-
-def main():
- global module
- global glusterbin
- module = AnsibleModule(
- argument_spec=dict(
- name=dict(type='str', required=True, aliases=['volume']),
- status_filter=dict(type='str', default='self-heal', choices=['self-heal', 'rebalance']),
- ),
- )
- is_old_facts = module._name in ('gluster_heal_facts', 'community.general.gluster_heal_facts')
- if is_old_facts:
- module.deprecate("The 'gluster_heal_facts' module has been renamed to 'gluster_heal_info', "
- "and the renamed one no longer returns ansible_facts",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
-
- glusterbin = module.get_bin_path('gluster', True)
- required_version = "3.2"
- status_filter = module.params['status_filter']
- volume_name = module.params['name']
- heal_info = ''
- rebalance_status = ''
-
- # Verify if required GlusterFS version is installed
- if is_invalid_gluster_version(module, required_version):
- module.fail_json(msg="GlusterFS version > %s is required" %
- required_version)
-
- try:
- if status_filter == "self-heal":
- heal_info = get_self_heal_status(volume_name)
- elif status_filter == "rebalance":
- rebalance_status = get_rebalance_status(volume_name)
- except Exception as e:
- module.fail_json(msg='Error retrieving status: %s' % e, exception=traceback.format_exc())
-
- facts = {}
- facts['glusterfs'] = {'volume': volume_name, 'status_filter': status_filter, 'heal_info': heal_info, 'rebalance': rebalance_status}
-
- if is_old_facts:
- module.exit_json(ansible_facts=facts)
- else:
- module.exit_json(**facts)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/storage/glusterfs/gluster_peer.py b/plugins/modules/storage/glusterfs/gluster_peer.py
deleted file mode 100644
index 29134abd29..0000000000
--- a/plugins/modules/storage/glusterfs/gluster_peer.py
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright 2015 Nandaja Varma
-# Copyright 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
-
-DOCUMENTATION = '''
----
-module: gluster_peer
-short_description: Attach/Detach peers to/from the cluster
-deprecated:
- removed_in: 3.0.0
- why: The gluster modules have migrated to the gluster.gluster collection.
- alternative: Use M(gluster.gluster.gluster_peer) instead.
-description:
- - Create or diminish a GlusterFS trusted storage pool. A set of nodes can be
- added into an existing trusted storage pool or a new storage pool can be
- formed. Or, nodes can be removed from an existing trusted storage pool.
-author: Sachidananda Urs (@sac)
-options:
- state:
- choices: ["present", "absent"]
- default: "present"
- description:
- - Determines whether the nodes should be attached to the pool or
- removed from the pool. If the state is present, nodes will be
- attached to the pool. If state is absent, nodes will be detached
- from the pool.
- type: str
- nodes:
- description:
- - List of nodes that have to be probed into the pool.
- required: true
- type: list
- force:
- type: bool
- default: false
- description:
- - Applicable only while removing the nodes from the pool. gluster
- will refuse to detach a node from the pool if any one of the node
- is down, in such cases force can be used.
-requirements:
- - GlusterFS > 3.2
-notes:
- - This module does not support check mode.
-'''
-
-EXAMPLES = '''
-- name: Create a trusted storage pool
- community.general.gluster_peer:
- state: present
- nodes:
- - 10.0.1.5
- - 10.0.1.10
-
-- name: Delete a node from the trusted storage pool
- community.general.gluster_peer:
- state: absent
- nodes:
- - 10.0.1.10
-
-- name: Delete a node from the trusted storage pool by force
- community.general.gluster_peer:
- state: absent
- nodes:
- - 10.0.0.1
- force: true
-'''
-
-RETURN = '''
-'''
-
-from ansible.module_utils.basic import AnsibleModule
-from distutils.version import LooseVersion
-
-
-class Peer(object):
- def __init__(self, module):
- self.module = module
- self.state = self.module.params['state']
- self.nodes = self.module.params['nodes']
- self.glustercmd = self.module.get_bin_path('gluster', True)
- self.lang = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C')
- self.action = ''
- self.force = ''
-
- def gluster_peer_ops(self):
- if not self.nodes:
- self.module.fail_json(msg="nodes list cannot be empty")
- self.force = 'force' if self.module.params.get('force') else ''
- if self.state == 'present':
- self.nodes = self.get_to_be_probed_hosts(self.nodes)
- self.action = 'probe'
- # In case of peer probe, we do not need `force'
- self.force = ''
- else:
- self.action = 'detach'
- self.call_peer_commands()
-
- def get_to_be_probed_hosts(self, hosts):
- peercmd = [self.glustercmd, 'pool', 'list', '--mode=script']
- rc, output, err = self.module.run_command(peercmd,
- environ_update=self.lang)
- peers_in_cluster = [line.split('\t')[1].strip() for
- line in filter(None, output.split('\n')[1:])]
- try:
- peers_in_cluster.remove('localhost')
- except ValueError:
- # It is ok not to have localhost in list
- pass
- hosts_to_be_probed = [host for host in hosts if host not in
- peers_in_cluster]
- return hosts_to_be_probed
-
- def call_peer_commands(self):
- result = {}
- result['msg'] = ''
- result['changed'] = False
-
- for node in self.nodes:
- peercmd = [self.glustercmd, 'peer', self.action, node, '--mode=script']
- if self.force:
- peercmd.append(self.force)
- rc, out, err = self.module.run_command(peercmd,
- environ_update=self.lang)
- if rc:
- result['rc'] = rc
- result['msg'] = err
- # Fail early, do not wait for the loop to finish
- self.module.fail_json(**result)
- else:
- if 'already in peer' in out or \
- 'localhost not needed' in out:
- result['changed'] |= False
- else:
- result['changed'] = True
- self.module.exit_json(**result)
-
-
-def main():
- module = AnsibleModule(
- argument_spec=dict(
- force=dict(type='bool', required=False, default=False),
- nodes=dict(type='list', required=True),
- state=dict(type='str', choices=['absent', 'present'],
- default='present'),
- ),
- supports_check_mode=False
- )
- pops = Peer(module)
- required_version = "3.2"
- # Verify if required GlusterFS version is installed
- if is_invalid_gluster_version(module, required_version):
- module.fail_json(msg="GlusterFS version > %s is required" %
- required_version)
- pops.gluster_peer_ops()
-
-
-def is_invalid_gluster_version(module, required_version):
- cmd = module.get_bin_path('gluster', True) + ' --version'
- result = module.run_command(cmd)
- ver_line = result[1].split('\n')[0]
- version = ver_line.split(' ')[1]
- # If the installed version is less than 3.2, it is an invalid version
- # return True
- return LooseVersion(version) < LooseVersion(required_version)
-
-
-if __name__ == "__main__":
- main()
diff --git a/plugins/modules/storage/glusterfs/gluster_volume.py b/plugins/modules/storage/glusterfs/gluster_volume.py
deleted file mode 100644
index 1a7f4cfce4..0000000000
--- a/plugins/modules/storage/glusterfs/gluster_volume.py
+++ /dev/null
@@ -1,608 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-# Copyright: (c) 2014, Taneli Leppä
-# 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
-
-DOCUMENTATION = '''
-module: gluster_volume
-short_description: Manage GlusterFS volumes
-deprecated:
- removed_in: 3.0.0
- why: The gluster modules have migrated to the gluster.gluster collection.
- alternative: Use M(gluster.gluster.gluster_volume) instead.
-description:
- - Create, remove, start, stop and tune GlusterFS volumes
-options:
- name:
- description:
- - The volume name.
- required: true
- aliases: ['volume']
- state:
- description:
- - Use present/absent ensure if a volume exists or not.
- Use started/stopped to control its availability.
- required: true
- choices: ['absent', 'present', 'started', 'stopped']
- cluster:
- description:
- - List of hosts to use for probing and brick setup.
- host:
- description:
- - Override local hostname (for peer probing purposes).
- replicas:
- description:
- - Replica count for volume.
- arbiters:
- description:
- - Arbiter count for volume.
- stripes:
- description:
- - Stripe count for volume.
- disperses:
- description:
- - Disperse count for volume.
- redundancies:
- description:
- - Redundancy count for volume.
- transport:
- description:
- - Transport type for volume.
- default: tcp
- choices: [ tcp, rdma, 'tcp,rdma' ]
- bricks:
- description:
- - Brick paths on servers. Multiple brick paths can be separated by commas.
- aliases: [ brick ]
- start_on_create:
- description:
- - Controls whether the volume is started after creation or not.
- type: bool
- default: 'yes'
- rebalance:
- description:
- - Controls whether the cluster is rebalanced after changes.
- type: bool
- default: 'no'
- directory:
- description:
- - Directory for limit-usage.
- options:
- description:
- - A dictionary/hash with options/settings for the volume.
- quota:
- description:
- - Quota value for limit-usage (be sure to use 10.0MB instead of 10MB, see quota list).
- force:
- description:
- - If brick is being created in the root partition, module will fail.
- Set force to true to override this behaviour.
- type: bool
- default: false
-notes:
- - Requires cli tools for GlusterFS on servers.
- - Will add new bricks, but not remove them.
-author:
-- Taneli Leppä (@rosmo)
-'''
-
-EXAMPLES = """
-- name: Create gluster volume
- community.general.gluster_volume:
- state: present
- name: test1
- bricks: /bricks/brick1/g1
- rebalance: yes
- cluster:
- - 192.0.2.10
- - 192.0.2.11
- run_once: true
-
-- name: Tune
- community.general.gluster_volume:
- state: present
- name: test1
- options:
- performance.cache-size: 256MB
-
-- name: Set multiple options on GlusterFS volume
- community.general.gluster_volume:
- state: present
- name: test1
- options:
- { performance.cache-size: 128MB,
- write-behind: 'off',
- quick-read: 'on'
- }
-
-- name: Start gluster volume
- community.general.gluster_volume:
- state: started
- name: test1
-
-- name: Limit usage
- community.general.gluster_volume:
- state: present
- name: test1
- directory: /foo
- quota: 20.0MB
-
-- name: Stop gluster volume
- community.general.gluster_volume:
- state: stopped
- name: test1
-
-- name: Remove gluster volume
- community.general.gluster_volume:
- state: absent
- name: test1
-
-- name: Create gluster volume with multiple bricks
- community.general.gluster_volume:
- state: present
- name: test2
- bricks: /bricks/brick1/g2,/bricks/brick2/g2
- cluster:
- - 192.0.2.10
- - 192.0.2.11
- run_once: true
-
-- name: Remove the bricks from gluster volume
- community.general.gluster_volume:
- state: present
- name: testvol
- bricks: /bricks/brick1/b1,/bricks/brick2/b2
- cluster:
- - 10.70.42.85
- force: true
- run_once: true
-
-- name: Reduce cluster configuration
- community.general.gluster_volume:
- state: present
- name: testvol
- bricks: /bricks/brick3/b1,/bricks/brick4/b2
- replicas: 2
- cluster:
- - 10.70.42.85
- force: true
- run_once: true
-"""
-
-import re
-import socket
-import time
-import traceback
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils._text import to_native
-
-glusterbin = ''
-
-
-def run_gluster(gargs, **kwargs):
- global glusterbin
- global module
- args = [glusterbin, '--mode=script']
- args.extend(gargs)
- try:
- rc, out, err = module.run_command(args, **kwargs)
- if rc != 0:
- module.fail_json(msg='error running gluster (%s) command (rc=%d): %s' %
- (' '.join(args), rc, out or err), exception=traceback.format_exc())
- except Exception as e:
- module.fail_json(msg='error running gluster (%s) command: %s' % (' '.join(args),
- to_native(e)), exception=traceback.format_exc())
- return out
-
-
-def run_gluster_nofail(gargs, **kwargs):
- global glusterbin
- global module
- args = [glusterbin]
- args.extend(gargs)
- rc, out, err = module.run_command(args, **kwargs)
- if rc != 0:
- return None
- return out
-
-
-def get_peers():
- out = run_gluster(['peer', 'status'])
- peers = {}
- hostname = None
- uuid = None
- state = None
- shortNames = False
- for row in out.split('\n'):
- if ': ' in row:
- key, value = row.split(': ')
- if key.lower() == 'hostname':
- hostname = value
- shortNames = False
- if key.lower() == 'uuid':
- uuid = value
- if key.lower() == 'state':
- state = value
- peers[hostname] = [uuid, state]
- elif row.lower() == 'other names:':
- shortNames = True
- elif row != '' and shortNames is True:
- peers[row] = [uuid, state]
- elif row == '':
- shortNames = False
- return peers
-
-
-def get_volumes():
- out = run_gluster(['volume', 'info'])
-
- volumes = {}
- volume = {}
- for row in out.split('\n'):
- if ': ' in row:
- key, value = row.split(': ')
- if key.lower() == 'volume name':
- volume['name'] = value
- volume['options'] = {}
- volume['quota'] = False
- if key.lower() == 'volume id':
- volume['id'] = value
- if key.lower() == 'status':
- volume['status'] = value
- if key.lower() == 'transport-type':
- volume['transport'] = value
- if value.lower().endswith(' (arbiter)'):
- if 'arbiters' not in volume:
- volume['arbiters'] = []
- value = value[:-10]
- volume['arbiters'].append(value)
- elif key.lower() == 'number of bricks':
- volume['replicas'] = value[-1:]
- if key.lower() != 'bricks' and key.lower()[:5] == 'brick':
- if 'bricks' not in volume:
- volume['bricks'] = []
- volume['bricks'].append(value)
- # Volume options
- if '.' in key:
- if 'options' not in volume:
- volume['options'] = {}
- volume['options'][key] = value
- if key == 'features.quota' and value == 'on':
- volume['quota'] = True
- else:
- if row.lower() != 'bricks:' and row.lower() != 'options reconfigured:':
- if len(volume) > 0:
- volumes[volume['name']] = volume
- volume = {}
- return volumes
-
-
-def get_quotas(name, nofail):
- quotas = {}
- if nofail:
- out = run_gluster_nofail(['volume', 'quota', name, 'list'])
- if not out:
- return quotas
- else:
- out = run_gluster(['volume', 'quota', name, 'list'])
- for row in out.split('\n'):
- if row[:1] == '/':
- q = re.split(r'\s+', row)
- quotas[q[0]] = q[1]
- return quotas
-
-
-def wait_for_peer(host):
- for x in range(0, 4):
- peers = get_peers()
- if host in peers and peers[host][1].lower().find('peer in cluster') != -1:
- return True
- time.sleep(1)
- return False
-
-
-def probe(host, myhostname):
- global module
- out = run_gluster(['peer', 'probe', host])
- if out.find('localhost') == -1 and not wait_for_peer(host):
- module.fail_json(msg='failed to probe peer %s on %s' % (host, myhostname))
-
-
-def probe_all_peers(hosts, peers, myhostname):
- for host in hosts:
- host = host.strip() # Clean up any extra space for exact comparison
- if host not in peers:
- probe(host, myhostname)
-
-
-def create_volume(name, stripe, replica, arbiter, disperse, redundancy, transport, hosts, bricks, force):
- args = ['volume', 'create']
- args.append(name)
- if stripe:
- args.append('stripe')
- args.append(str(stripe))
- if replica:
- args.append('replica')
- args.append(str(replica))
- if arbiter:
- args.append('arbiter')
- args.append(str(arbiter))
- if disperse:
- args.append('disperse')
- args.append(str(disperse))
- if redundancy:
- args.append('redundancy')
- args.append(str(redundancy))
- args.append('transport')
- args.append(transport)
- for brick in bricks:
- for host in hosts:
- args.append(('%s:%s' % (host, brick)))
- if force:
- args.append('force')
- run_gluster(args)
-
-
-def start_volume(name):
- run_gluster(['volume', 'start', name])
-
-
-def stop_volume(name):
- run_gluster(['volume', 'stop', name])
-
-
-def set_volume_option(name, option, parameter):
- run_gluster(['volume', 'set', name, option, parameter])
-
-
-def add_bricks(name, new_bricks, stripe, replica, force):
- args = ['volume', 'add-brick', name]
- if stripe:
- args.append('stripe')
- args.append(str(stripe))
- if replica:
- args.append('replica')
- args.append(str(replica))
- args.extend(new_bricks)
- if force:
- args.append('force')
- run_gluster(args)
-
-
-def remove_bricks(name, removed_bricks, force):
- # max-tries=12 with default_interval=10 secs
- max_tries = 12
- retries = 0
- success = False
- args = ['volume', 'remove-brick', name]
- args.extend(removed_bricks)
- # create a copy of args to use for commit operation
- args_c = args[:]
- args.append('start')
- run_gluster(args)
- # remove-brick operation needs to be followed by commit operation.
- if not force:
- module.fail_json(msg="Force option is mandatory.")
- else:
- while retries < max_tries:
- last_brick = removed_bricks[-1]
- out = run_gluster(['volume', 'remove-brick', name, last_brick, 'status'])
- for row in out.split('\n')[1:]:
- if 'completed' in row:
- # remove-brick successful, call commit operation.
- args_c.append('commit')
- out = run_gluster(args_c)
- success = True
- break
- else:
- time.sleep(10)
- if success:
- break
- retries += 1
- if not success:
- # remove-brick still in process, needs to be committed after completion.
- module.fail_json(msg="Exceeded number of tries, check remove-brick status.\n"
- "Commit operation needs to be followed.")
-
-
-def reduce_config(name, removed_bricks, replicas, force):
- out = run_gluster(['volume', 'heal', name, 'info'])
- summary = out.split("\n")
- for line in summary:
- if 'Number' in line and int(line.split(":")[1].strip()) != 0:
- module.fail_json(msg="Operation aborted, self-heal in progress.")
- args = ['volume', 'remove-brick', name, 'replica', replicas]
- args.extend(removed_bricks)
- if force:
- args.append('force')
- else:
- module.fail_json(msg="Force option is mandatory")
- run_gluster(args)
-
-
-def do_rebalance(name):
- run_gluster(['volume', 'rebalance', name, 'start'])
-
-
-def enable_quota(name):
- run_gluster(['volume', 'quota', name, 'enable'])
-
-
-def set_quota(name, directory, value):
- run_gluster(['volume', 'quota', name, 'limit-usage', directory, value])
-
-
-def main():
- # MAIN
-
- global module
- module = AnsibleModule(
- argument_spec=dict(
- name=dict(type='str', required=True, aliases=['volume']),
- state=dict(type='str', required=True, choices=['absent', 'started', 'stopped', 'present']),
- cluster=dict(type='list'),
- host=dict(type='str'),
- stripes=dict(type='int'),
- replicas=dict(type='int'),
- arbiters=dict(type='int'),
- disperses=dict(type='int'),
- redundancies=dict(type='int'),
- transport=dict(type='str', default='tcp', choices=['tcp', 'rdma', 'tcp,rdma']),
- bricks=dict(type='str', aliases=['brick']),
- start_on_create=dict(type='bool', default=True),
- rebalance=dict(type='bool', default=False),
- options=dict(type='dict', default={}),
- quota=dict(type='str'),
- directory=dict(type='str'),
- force=dict(type='bool', default=False),
- ),
- )
-
- global glusterbin
- glusterbin = module.get_bin_path('gluster', True)
-
- changed = False
-
- action = module.params['state']
- volume_name = module.params['name']
- cluster = module.params['cluster']
- brick_paths = module.params['bricks']
- stripes = module.params['stripes']
- replicas = module.params['replicas']
- arbiters = module.params['arbiters']
- disperses = module.params['disperses']
- redundancies = module.params['redundancies']
- transport = module.params['transport']
- myhostname = module.params['host']
- start_on_create = module.boolean(module.params['start_on_create'])
- rebalance = module.boolean(module.params['rebalance'])
- force = module.boolean(module.params['force'])
-
- if not myhostname:
- myhostname = socket.gethostname()
-
- # Clean up if last element is empty. Consider that yml can look like this:
- # cluster="{% for host in groups['glusterfs'] %}{{ hostvars[host]['private_ip'] }},{% endfor %}"
- if cluster is not None and len(cluster) > 1 and cluster[-1] == '':
- cluster = cluster[0:-1]
-
- if cluster is None:
- cluster = []
-
- if brick_paths is not None and "," in brick_paths:
- brick_paths = brick_paths.split(",")
- else:
- brick_paths = [brick_paths]
-
- options = module.params['options']
- quota = module.params['quota']
- directory = module.params['directory']
-
- # get current state info
- peers = get_peers()
- volumes = get_volumes()
- quotas = {}
- if volume_name in volumes and volumes[volume_name]['quota'] and volumes[volume_name]['status'].lower() == 'started':
- quotas = get_quotas(volume_name, True)
-
- # do the work!
- if action == 'absent':
- if volume_name in volumes:
- if volumes[volume_name]['status'].lower() != 'stopped':
- stop_volume(volume_name)
- run_gluster(['volume', 'delete', volume_name])
- changed = True
-
- if action == 'present':
- probe_all_peers(cluster, peers, myhostname)
-
- # create if it doesn't exist
- if volume_name not in volumes:
- create_volume(volume_name, stripes, replicas, arbiters, disperses, redundancies, transport, cluster, brick_paths, force)
- volumes = get_volumes()
- changed = True
-
- if volume_name in volumes:
- if volumes[volume_name]['status'].lower() != 'started' and start_on_create:
- start_volume(volume_name)
- changed = True
-
- # switch bricks
- new_bricks = []
- removed_bricks = []
- all_bricks = []
- bricks_in_volume = volumes[volume_name]['bricks']
-
- for node in cluster:
- for brick_path in brick_paths:
- brick = '%s:%s' % (node, brick_path)
- all_bricks.append(brick)
- if brick not in bricks_in_volume:
- new_bricks.append(brick)
-
- if not new_bricks and len(all_bricks) > 0 and \
- len(all_bricks) < len(bricks_in_volume):
- for brick in bricks_in_volume:
- if brick not in all_bricks:
- removed_bricks.append(brick)
-
- if new_bricks:
- add_bricks(volume_name, new_bricks, stripes, replicas, force)
- changed = True
-
- if removed_bricks:
- if replicas and int(replicas) < int(volumes[volume_name]['replicas']):
- reduce_config(volume_name, removed_bricks, str(replicas), force)
- else:
- remove_bricks(volume_name, removed_bricks, force)
- changed = True
-
- # handle quotas
- if quota:
- if not volumes[volume_name]['quota']:
- enable_quota(volume_name)
- quotas = get_quotas(volume_name, False)
- if directory not in quotas or quotas[directory] != quota:
- set_quota(volume_name, directory, quota)
- changed = True
-
- # set options
- for option in options.keys():
- if option not in volumes[volume_name]['options'] or volumes[volume_name]['options'][option] != options[option]:
- set_volume_option(volume_name, option, options[option])
- changed = True
-
- else:
- module.fail_json(msg='failed to create volume %s' % volume_name)
-
- if action != 'absent' and volume_name not in volumes:
- module.fail_json(msg='volume not found %s' % volume_name)
-
- if action == 'started':
- if volumes[volume_name]['status'].lower() != 'started':
- start_volume(volume_name)
- changed = True
-
- if action == 'stopped':
- if volumes[volume_name]['status'].lower() != 'stopped':
- stop_volume(volume_name)
- changed = True
-
- if changed:
- volumes = get_volumes()
- if rebalance:
- do_rebalance(volume_name)
-
- facts = {}
- facts['glusterfs'] = {'peers': peers, 'volumes': volumes, 'quotas': quotas}
-
- module.exit_json(changed=changed, ansible_facts=facts)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/storage/netapp/na_ontap_gather_facts.py b/plugins/modules/storage/netapp/na_ontap_gather_facts.py
deleted file mode 100644
index c7b541ff08..0000000000
--- a/plugins/modules/storage/netapp/na_ontap_gather_facts.py
+++ /dev/null
@@ -1,613 +0,0 @@
-#!/usr/bin/python
-
-# (c) 2018 Piotr Olczak
-# (c) 2018-2019, NetApp, 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
-
-DOCUMENTATION = '''
-module: na_ontap_gather_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(netapp.ontap.na_ontap_info) instead.
-author: Piotr Olczak (@dprts)
-extends_documentation_fragment:
-- community.general._netapp.na_ontap
-
-short_description: NetApp information gatherer
-description:
- - This module allows you to gather various information about ONTAP configuration
-requirements:
- - netapp_lib
-options:
- state:
- description:
- - Returns "info"
- default: info
- choices: [info]
- type: str
- gather_subset:
- description:
- - When supplied, this argument will restrict the facts collected
- to a given subset. Possible values for this argument include
- C(aggregate_info), C(cluster_node_info), C(igroup_info), C(lun_info), C(net_dns_info),
- C(net_ifgrp_info),
- C(net_interface_info), C(net_port_info), C(nvme_info), C(nvme_interface_info),
- C(nvme_namespace_info), C(nvme_subsystem_info), C(ontap_version),
- C(qos_adaptive_policy_info), C(qos_policy_info), C(security_key_manager_key_info),
- C(security_login_account_info), C(storage_failover_info), C(volume_info),
- C(vserver_info), C(vserver_login_banner_info), C(vserver_motd_info), C(vserver_nfs_info)
- Can specify a list of values to include a larger subset. Values can also be used
- with an initial C(M(!)) to specify that a specific subset should
- not be collected.
- - nvme is supported with ONTAP 9.4 onwards.
- - use C(help) to get a list of supported facts for your system.
- default: all
- type: list
- elements: str
-'''
-
-EXAMPLES = '''
-- name: Get NetApp info (Password Authentication)
- community.general.na_ontap_gather_facts:
- state: info
- hostname: "na-vsim"
- username: "admin"
- password: "admins_password"
-- ansible.builtin.debug:
- var: ontap_facts
-- name: Limit Fact Gathering to Aggregate Information
- community.general.na_ontap_gather_facts:
- state: info
- hostname: "na-vsim"
- username: "admin"
- password: "admins_password"
- gather_subset: "aggregate_info"
-- name: Limit Fact Gathering to Volume and Lun Information
- community.general.na_ontap_gather_facts:
- state: info
- hostname: "na-vsim"
- username: "admin"
- password: "admins_password"
- gather_subset:
- - volume_info
- - lun_info
-- name: Gather all facts except for volume and lun information
- community.general.na_ontap_gather_facts:
- state: info
- hostname: "na-vsim"
- username: "admin"
- password: "admins_password"
- gather_subset:
- - "!volume_info"
- - "!lun_info"
-'''
-
-RETURN = '''
-ontap_facts:
- description: Returns various information about NetApp cluster configuration
- returned: always
- type: dict
- sample: '{
- "ontap_facts": {
- "aggregate_info": {...},
- "cluster_node_info": {...},
- "net_dns_info": {...},
- "net_ifgrp_info": {...},
- "net_interface_info": {...},
- "net_port_info": {...},
- "security_key_manager_key_info": {...},
- "security_login_account_info": {...},
- "volume_info": {...},
- "lun_info": {...},
- "storage_failover_info": {...},
- "vserver_login_banner_info": {...},
- "vserver_motd_info": {...},
- "vserver_info": {...},
- "vserver_nfs_info": {...},
- "ontap_version": {...},
- "igroup_info": {...},
- "qos_policy_info": {...},
- "qos_adaptive_policy_info": {...}
- }'
-'''
-
-import traceback
-from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils._text import to_native
-import ansible_collections.community.general.plugins.module_utils._netapp as netapp_utils
-
-try:
- import xmltodict
- HAS_XMLTODICT = True
-except ImportError:
- HAS_XMLTODICT = False
-
-try:
- import json
- HAS_JSON = True
-except ImportError:
- HAS_JSON = False
-
-HAS_NETAPP_LIB = netapp_utils.has_netapp_lib()
-
-
-class NetAppONTAPGatherFacts(object):
- '''Class with gather facts methods'''
-
- def __init__(self, module):
- self.module = module
- self.netapp_info = dict()
-
- # thanks to coreywan (https://github.com/ansible/ansible/pull/47016)
- # for starting this
- # min_version identifies the ontapi version which supports this ZAPI
- # use 0 if it is supported since 9.1
- self.fact_subsets = {
- 'net_dns_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'net-dns-get-iter',
- 'attribute': 'net-dns-info',
- 'field': 'vserver-name',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'net_interface_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'net-interface-get-iter',
- 'attribute': 'net-interface-info',
- 'field': 'interface-name',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'net_port_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'net-port-get-iter',
- 'attribute': 'net-port-info',
- 'field': ('node', 'port'),
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'cluster_node_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'cluster-node-get-iter',
- 'attribute': 'cluster-node-info',
- 'field': 'node-name',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'security_login_account_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'security-login-get-iter',
- 'attribute': 'security-login-account-info',
- 'field': ('vserver', 'user-name', 'application', 'authentication-method'),
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'aggregate_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'aggr-get-iter',
- 'attribute': 'aggr-attributes',
- 'field': 'aggregate-name',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'volume_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'volume-get-iter',
- 'attribute': 'volume-attributes',
- 'field': ('name', 'owning-vserver-name'),
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'lun_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'lun-get-iter',
- 'attribute': 'lun-info',
- 'field': 'path',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'storage_failover_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'cf-get-iter',
- 'attribute': 'storage-failover-info',
- 'field': 'node',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'vserver_motd_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'vserver-motd-get-iter',
- 'attribute': 'vserver-motd-info',
- 'field': 'vserver',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'vserver_login_banner_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'vserver-login-banner-get-iter',
- 'attribute': 'vserver-login-banner-info',
- 'field': 'vserver',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'security_key_manager_key_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'security-key-manager-key-get-iter',
- 'attribute': 'security-key-manager-key-info',
- 'field': ('node', 'key-id'),
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'vserver_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'vserver-get-iter',
- 'attribute': 'vserver-info',
- 'field': 'vserver-name',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'vserver_nfs_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'nfs-service-get-iter',
- 'attribute': 'nfs-info',
- 'field': 'vserver',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'net_ifgrp_info': {
- 'method': self.get_ifgrp_info,
- 'kwargs': {},
- 'min_version': '0',
- },
- 'ontap_version': {
- 'method': self.ontapi,
- 'kwargs': {},
- 'min_version': '0',
- },
- 'system_node_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'system-node-get-iter',
- 'attribute': 'node-details-info',
- 'field': 'node',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'igroup_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'igroup-get-iter',
- 'attribute': 'initiator-group-info',
- 'field': ('vserver', 'initiator-group-name'),
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- 'qos_policy_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'qos-policy-group-get-iter',
- 'attribute': 'qos-policy-group-info',
- 'field': 'policy-group',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '0',
- },
- # supported in ONTAP 9.3 and onwards
- 'qos_adaptive_policy_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'qos-adaptive-policy-group-get-iter',
- 'attribute': 'qos-adaptive-policy-group-info',
- 'field': 'policy-group',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '130',
- },
- # supported in ONTAP 9.4 and onwards
- 'nvme_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'nvme-get-iter',
- 'attribute': 'nvme-target-service-info',
- 'field': 'vserver',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '140',
- },
- 'nvme_interface_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'nvme-interface-get-iter',
- 'attribute': 'nvme-interface-info',
- 'field': 'vserver',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '140',
- },
- 'nvme_subsystem_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'nvme-subsystem-get-iter',
- 'attribute': 'nvme-subsystem-info',
- 'field': 'subsystem',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '140',
- },
- 'nvme_namespace_info': {
- 'method': self.get_generic_get_iter,
- 'kwargs': {
- 'call': 'nvme-namespace-get-iter',
- 'attribute': 'nvme-namespace-info',
- 'field': 'path',
- 'query': {'max-records': '1024'},
- },
- 'min_version': '140',
- },
- }
-
- if HAS_NETAPP_LIB is False:
- self.module.fail_json(msg="the python NetApp-Lib module is required")
- else:
- self.server = netapp_utils.setup_na_ontap_zapi(module=self.module)
-
- def ontapi(self):
- '''Method to get ontapi version'''
-
- api = 'system-get-ontapi-version'
- api_call = netapp_utils.zapi.NaElement(api)
- try:
- results = self.server.invoke_successfully(api_call, enable_tunneling=False)
- ontapi_version = results.get_child_content('minor-version')
- return ontapi_version if ontapi_version is not None else '0'
- except netapp_utils.zapi.NaApiError as error:
- self.module.fail_json(msg="Error calling API %s: %s" %
- (api, to_native(error)), exception=traceback.format_exc())
-
- def call_api(self, call, query=None):
- '''Main method to run an API call'''
-
- api_call = netapp_utils.zapi.NaElement(call)
- result = None
-
- if query:
- for key, val in query.items():
- # Can val be nested?
- api_call.add_new_child(key, val)
- try:
- result = self.server.invoke_successfully(api_call, enable_tunneling=False)
- return result
- except netapp_utils.zapi.NaApiError as error:
- if call in ['security-key-manager-key-get-iter']:
- return result
- else:
- self.module.fail_json(msg="Error calling API %s: %s"
- % (call, to_native(error)), exception=traceback.format_exc())
-
- def get_ifgrp_info(self):
- '''Method to get network port ifgroups info'''
-
- try:
- net_port_info = self.netapp_info['net_port_info']
- except KeyError:
- net_port_info_calls = self.fact_subsets['net_port_info']
- net_port_info = net_port_info_calls['method'](**net_port_info_calls['kwargs'])
- interfaces = net_port_info.keys()
-
- ifgrps = []
- for ifn in interfaces:
- if net_port_info[ifn]['port_type'] == 'if_group':
- ifgrps.append(ifn)
-
- net_ifgrp_info = dict()
- for ifgrp in ifgrps:
- query = dict()
- query['node'], query['ifgrp-name'] = ifgrp.split(':')
-
- tmp = self.get_generic_get_iter('net-port-ifgrp-get', field=('node', 'ifgrp-name'),
- attribute='net-ifgrp-info', query=query)
- net_ifgrp_info = net_ifgrp_info.copy()
- net_ifgrp_info.update(tmp)
- return net_ifgrp_info
-
- def get_generic_get_iter(self, call, attribute=None, field=None, query=None):
- '''Method to run a generic get-iter call'''
-
- generic_call = self.call_api(call, query)
-
- if call == 'net-port-ifgrp-get':
- children = 'attributes'
- else:
- children = 'attributes-list'
-
- if generic_call is None:
- return None
-
- if field is None:
- out = []
- else:
- out = {}
-
- attributes_list = generic_call.get_child_by_name(children)
-
- if attributes_list is None:
- return None
-
- for child in attributes_list.get_children():
- dic = xmltodict.parse(child.to_string(), xml_attribs=False)
-
- if attribute is not None:
- dic = dic[attribute]
-
- if isinstance(field, str):
- unique_key = _finditem(dic, field)
- out = out.copy()
- out.update({unique_key: convert_keys(json.loads(json.dumps(dic)))})
- elif isinstance(field, tuple):
- unique_key = ':'.join([_finditem(dic, el) for el in field])
- out = out.copy()
- out.update({unique_key: convert_keys(json.loads(json.dumps(dic)))})
- else:
- out.append(convert_keys(json.loads(json.dumps(dic))))
-
- return out
-
- def get_all(self, gather_subset):
- '''Method to get all subsets'''
-
- results = netapp_utils.get_cserver(self.server)
- cserver = netapp_utils.setup_na_ontap_zapi(module=self.module, vserver=results)
- netapp_utils.ems_log_event("na_ontap_gather_facts", cserver)
-
- self.netapp_info['ontap_version'] = self.ontapi()
-
- run_subset = self.get_subset(gather_subset, self.netapp_info['ontap_version'])
- if 'help' in gather_subset:
- self.netapp_info['help'] = sorted(run_subset)
- else:
- for subset in run_subset:
- call = self.fact_subsets[subset]
- self.netapp_info[subset] = call['method'](**call['kwargs'])
-
- return self.netapp_info
-
- def get_subset(self, gather_subset, version):
- '''Method to get a single subset'''
-
- runable_subsets = set()
- exclude_subsets = set()
- usable_subsets = [key for key in self.fact_subsets.keys() if version >= self.fact_subsets[key]['min_version']]
- if 'help' in gather_subset:
- return usable_subsets
- for subset in gather_subset:
- if subset == 'all':
- runable_subsets.update(usable_subsets)
- return runable_subsets
- if subset.startswith('!'):
- subset = subset[1:]
- if subset == 'all':
- return set()
- exclude = True
- else:
- exclude = False
-
- if subset not in usable_subsets:
- if subset not in self.fact_subsets.keys():
- self.module.fail_json(msg='Bad subset: %s' % subset)
- self.module.fail_json(msg='Remote system at version %s does not support %s' %
- (version, subset))
-
- if exclude:
- exclude_subsets.add(subset)
- else:
- runable_subsets.add(subset)
-
- if not runable_subsets:
- runable_subsets.update(usable_subsets)
-
- runable_subsets.difference_update(exclude_subsets)
-
- return runable_subsets
-
-
-# https://stackoverflow.com/questions/14962485/finding-a-key-recursively-in-a-dictionary
-def __finditem(obj, key):
-
- if key in obj:
- return obj[key]
- for dummy, val in obj.items():
- if isinstance(val, dict):
- item = __finditem(val, key)
- if item is not None:
- return item
- return None
-
-
-def _finditem(obj, key):
-
- value = __finditem(obj, key)
- if value is not None:
- return value
- raise KeyError(key)
-
-
-def convert_keys(d_param):
- '''Method to convert hyphen to underscore'''
-
- out = {}
- if isinstance(d_param, dict):
- for key, val in d_param.items():
- val = convert_keys(val)
- out[key.replace('-', '_')] = val
- else:
- return d_param
- return out
-
-
-def main():
- '''Execute action'''
-
- argument_spec = netapp_utils.na_ontap_host_argument_spec()
- argument_spec.update(dict(
- state=dict(default='info', choices=['info']),
- gather_subset=dict(default=['all'], type='list', elements='str'),
- ))
-
- module = AnsibleModule(
- argument_spec=argument_spec,
- supports_check_mode=True
- )
-
- if not HAS_XMLTODICT:
- module.fail_json(msg="xmltodict missing")
-
- if not HAS_JSON:
- module.fail_json(msg="json missing")
-
- state = module.params['state']
- gather_subset = module.params['gather_subset']
- if gather_subset is None:
- gather_subset = ['all']
- gf_obj = NetAppONTAPGatherFacts(module)
- gf_all = gf_obj.get_all(gather_subset)
- result = {'state': state, 'changed': False}
- module.exit_json(ansible_facts={'ontap_facts': gf_all}, **result)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/storage/purestorage/purefa_facts.py b/plugins/modules/storage/purestorage/purefa_facts.py
deleted file mode 100644
index 5e8b593260..0000000000
--- a/plugins/modules/storage/purestorage/purefa_facts.py
+++ /dev/null
@@ -1,858 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-# (c) 2018, Simon Dodsley (simon@purestorage.com)
-# 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
-
-DOCUMENTATION = r'''
----
-module: purefa_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favor of C(_info) module.
- alternative: Use M(purestorage.flasharray.purefa_info) instead.
-short_description: Collect facts from Pure Storage FlashArray
-description:
- - Collect facts information from a Pure Storage Flasharray running the
- Purity//FA operating system. By default, the module will collect basic
- fact information including hosts, host groups, protection
- groups and volume counts. Additional fact information can be collected
- based on the configured set of arguments.
-author:
- - Pure Storage ansible Team (@sdodsley)
-options:
- gather_subset:
- description:
- - When supplied, this argument will define the facts to be collected.
- Possible values for this include all, minimum, config, performance,
- capacity, network, subnet, interfaces, hgroups, pgroups, hosts,
- admins, volumes, snapshots, pods, vgroups, offload, apps and arrays.
- type: list
- required: false
- default: minimum
-extends_documentation_fragment:
-- community.general.purestorage.fa
-
-'''
-
-EXAMPLES = r'''
-- name: Collect default set of facts
- community.general.purefa_facts:
- fa_url: 10.10.10.2
- api_token: e31060a7-21fc-e277-6240-25983c6c4592
-
-- name: Collect configuration and capacity facts
- community.general.purefa_facts:
- gather_subset:
- - config
- - capacity
- fa_url: 10.10.10.2
- api_token: e31060a7-21fc-e277-6240-25983c6c4592
-
-- name: Collect all facts
- community.general.purefa_facts:
- gather_subset:
- - all
- fa_url: 10.10.10.2
- api_token: e31060a7-21fc-e277-6240-25983c6c4592
-'''
-
-RETURN = r'''
-ansible_facts:
- description: Returns the facts collected from the FlashArray
- returned: always
- type: complex
- sample: {
- "capacity": {},
- "config": {
- "directory_service": {
- "array_admin_group": null,
- "base_dn": null,
- "bind_password": null,
- "bind_user": null,
- "check_peer": false,
- "enabled": false,
- "group_base": null,
- "readonly_group": null,
- "storage_admin_group": null,
- "uri": []
- },
- "dns": {
- "domain": "domain.com",
- "nameservers": [
- "8.8.8.8",
- "8.8.4.4"
- ]
- },
- "ntp": [
- "0.ntp.pool.org",
- "1.ntp.pool.org",
- "2.ntp.pool.org",
- "3.ntp.pool.org"
- ],
- "smtp": [
- {
- "enabled": true,
- "name": "alerts@acme.com"
- },
- {
- "enabled": true,
- "name": "user@acme.com"
- }
- ],
- "snmp": [
- {
- "auth_passphrase": null,
- "auth_protocol": null,
- "community": null,
- "host": "localhost",
- "name": "localhost",
- "privacy_passphrase": null,
- "privacy_protocol": null,
- "user": null,
- "version": "v2c"
- }
- ],
- "ssl_certs": {
- "country": null,
- "email": null,
- "issued_by": "",
- "issued_to": "",
- "key_size": 2048,
- "locality": null,
- "organization": "Acme Storage, Inc.",
- "organizational_unit": "Acme Storage, Inc.",
- "state": null,
- "status": "self-signed",
- "valid_from": "2017-08-11T23:09:06Z",
- "valid_to": "2027-08-09T23:09:06Z"
- },
- "syslog": []
- },
- "default": {
- "array_name": "flasharray1",
- "connected_arrays": 1,
- "hostgroups": 0,
- "hosts": 10,
- "pods": 3,
- "protection_groups": 1,
- "purity_version": "5.0.4",
- "snapshots": 1,
- "volume_groups": 2
- },
- "hgroups": {},
- "hosts": {
- "host1": {
- "hgroup": null,
- "iqn": [
- "iqn.1994-05.com.redhat:2f6f5715a533"
- ],
- "wwn": []
- },
- "host2": {
- "hgroup": null,
- "iqn": [
- "iqn.1994-05.com.redhat:d17fb13fe0b"
- ],
- "wwn": []
- },
- "host3": {
- "hgroup": null,
- "iqn": [
- "iqn.1994-05.com.redhat:97b1351bfb2"
- ],
- "wwn": []
- },
- "host4": {
- "hgroup": null,
- "iqn": [
- "iqn.1994-05.com.redhat:dd84e9a7b2cb"
- ],
- "wwn": [
- "10000000C96C48D1",
- "10000000C96C48D2"
- ]
- }
- },
- "interfaces": {
- "CT0.ETH4": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682",
- "CT0.ETH5": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682",
- "CT1.ETH4": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682",
- "CT1.ETH5": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682"
- },
- "network": {
- "ct0.eth0": {
- "address": "10.10.10.10",
- "gateway": "10.10.10.1",
- "hwaddr": "ec:f4:bb:c8:8a:04",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "services": [
- "management"
- ],
- "speed": 1000000000
- },
- "ct0.eth2": {
- "address": "10.10.10.11",
- "gateway": null,
- "hwaddr": "ec:f4:bb:c8:8a:00",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "services": [
- "replication"
- ],
- "speed": 10000000000
- },
- "ct0.eth3": {
- "address": "10.10.10.12",
- "gateway": null,
- "hwaddr": "ec:f4:bb:c8:8a:02",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "services": [
- "replication"
- ],
- "speed": 10000000000
- },
- "ct0.eth4": {
- "address": "10.10.10.13",
- "gateway": null,
- "hwaddr": "90:e2:ba:83:79:0c",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "services": [
- "iscsi"
- ],
- "speed": 10000000000
- },
- "ct0.eth5": {
- "address": "10.10.10.14",
- "gateway": null,
- "hwaddr": "90:e2:ba:83:79:0d",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "services": [
- "iscsi"
- ],
- "speed": 10000000000
- },
- "vir0": {
- "address": "10.10.10.20",
- "gateway": "10.10.10.1",
- "hwaddr": "fe:ba:e9:e7:6b:0f",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "services": [
- "management"
- ],
- "speed": 1000000000
- }
- },
- "offload": {
- "nfstarget": {
- "address": "10.0.2.53",
- "mount_options": null,
- "mount_point": "/offload",
- "protocol": "nfs",
- "status": "scanning"
- }
- },
- "performance": {
- "input_per_sec": 8191,
- "output_per_sec": 0,
- "queue_depth": 1,
- "reads_per_sec": 0,
- "san_usec_per_write_op": 15,
- "usec_per_read_op": 0,
- "usec_per_write_op": 642,
- "writes_per_sec": 2
- },
- "pgroups": {
- "consisgroup-07b6b983-986e-46f5-bdc3-deaa3dbb299e-cinder": {
- "hgroups": null,
- "hosts": null,
- "source": "host1",
- "targets": null,
- "volumes": [
- "volume-1"
- ]
- }
- },
- "pods": {
- "srm-pod": {
- "arrays": [
- {
- "array_id": "52595f7e-b460-4b46-8851-a5defd2ac192",
- "mediator_status": "online",
- "name": "sn1-405-c09-37",
- "status": "online"
- },
- {
- "array_id": "a2c32301-f8a0-4382-949b-e69b552ce8ca",
- "mediator_status": "online",
- "name": "sn1-420-c11-31",
- "status": "online"
- }
- ],
- "source": null
- }
- },
- "snapshots": {
- "consisgroup.cgsnapshot": {
- "created": "2018-03-28T09:34:02Z",
- "size": 13958643712,
- "source": "volume-1"
- }
- },
- "subnet": {},
- "vgroups": {
- "vvol--vSphere-HA-0ffc7dd1-vg": {
- "volumes": [
- "vvol--vSphere-HA-0ffc7dd1-vg/Config-aad5d7c6"
- ]
- }
- },
- "volumes": {
- "ansible_data": {
- "bandwidth": null,
- "hosts": [
- [
- "host1",
- 1
- ]
- ],
- "serial": "43BE47C12334399B000114A6",
- "size": 1099511627776,
- "source": null
- }
- }
- }
-'''
-
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils.pure import get_system, purefa_argument_spec
-
-
-ADMIN_API_VERSION = '1.14'
-S3_REQUIRED_API_VERSION = '1.16'
-LATENCY_REQUIRED_API_VERSION = '1.16'
-AC_REQUIRED_API_VERSION = '1.14'
-CAP_REQUIRED_API_VERSION = '1.6'
-SAN_REQUIRED_API_VERSION = '1.10'
-NVME_API_VERSION = '1.16'
-PREFERRED_API_VERSION = '1.15'
-CONN_STATUS_API_VERSION = '1.17'
-
-
-def generate_default_dict(array):
- default_facts = {}
- defaults = array.get()
- api_version = array._list_available_rest_versions()
- if AC_REQUIRED_API_VERSION in api_version:
- default_facts['volume_groups'] = len(array.list_vgroups())
- default_facts['connected_arrays'] = len(array.list_array_connections())
- default_facts['pods'] = len(array.list_pods())
- default_facts['connection_key'] = array.get(connection_key=True)['connection_key']
- hosts = array.list_hosts()
- admins = array.list_admins()
- snaps = array.list_volumes(snap=True, pending=True)
- pgroups = array.list_pgroups(pending=True)
- hgroups = array.list_hgroups()
- # Old FA arrays only report model from the primary controller
- ct0_model = array.get_hardware('CT0')['model']
- if ct0_model:
- model = ct0_model
- else:
- ct1_model = array.get_hardware('CT1')['model']
- model = ct1_model
- default_facts['array_model'] = model
- default_facts['array_name'] = defaults['array_name']
- default_facts['purity_version'] = defaults['version']
- default_facts['hosts'] = len(hosts)
- default_facts['snapshots'] = len(snaps)
- default_facts['protection_groups'] = len(pgroups)
- default_facts['hostgroups'] = len(hgroups)
- default_facts['admins'] = len(admins)
- return default_facts
-
-
-def generate_perf_dict(array):
- perf_facts = {}
- api_version = array._list_available_rest_versions()
- if LATENCY_REQUIRED_API_VERSION in api_version:
- latency_info = array.get(action='monitor', latency=True)[0]
- perf_info = array.get(action='monitor')[0]
- # IOPS
- perf_facts['writes_per_sec'] = perf_info['writes_per_sec']
- perf_facts['reads_per_sec'] = perf_info['reads_per_sec']
-
- # Bandwidth
- perf_facts['input_per_sec'] = perf_info['input_per_sec']
- perf_facts['output_per_sec'] = perf_info['output_per_sec']
-
- # Latency
- if LATENCY_REQUIRED_API_VERSION in api_version:
- perf_facts['san_usec_per_read_op'] = latency_info['san_usec_per_read_op']
- perf_facts['san_usec_per_write_op'] = latency_info['san_usec_per_write_op']
- perf_facts['queue_usec_per_read_op'] = latency_info['queue_usec_per_read_op']
- perf_facts['queue_usec_per_write_op'] = latency_info['queue_usec_per_write_op']
- perf_facts['qos_rate_limit_usec_per_read_op'] = latency_info['qos_rate_limit_usec_per_read_op']
- perf_facts['qos_rate_limit_usec_per_write_op'] = latency_info['qos_rate_limit_usec_per_write_op']
- perf_facts['local_queue_usec_per_op'] = perf_info['local_queue_usec_per_op']
- perf_facts['usec_per_read_op'] = perf_info['usec_per_read_op']
- perf_facts['usec_per_write_op'] = perf_info['usec_per_write_op']
- perf_facts['queue_depth'] = perf_info['queue_depth']
- return perf_facts
-
-
-def generate_config_dict(array):
- config_facts = {}
- api_version = array._list_available_rest_versions()
- # DNS
- config_facts['dns'] = array.get_dns()
- # SMTP
- config_facts['smtp'] = array.list_alert_recipients()
- # SNMP
- config_facts['snmp'] = array.list_snmp_managers()
- config_facts['snmp_v3_engine_id'] = array.get_snmp_engine_id()['engine_id']
- # DS
- config_facts['directory_service'] = array.get_directory_service()
- if S3_REQUIRED_API_VERSION in api_version:
- config_facts['directory_service_roles'] = {}
- roles = array.list_directory_service_roles()
- for role in range(0, len(roles)):
- role_name = roles[role]['name']
- config_facts['directory_service_roles'][role_name] = {
- 'group': roles[role]['group'],
- 'group_base': roles[role]['group_base'],
- }
- else:
- config_facts['directory_service'].update(array.get_directory_service(groups=True))
- # NTP
- config_facts['ntp'] = array.get(ntpserver=True)['ntpserver']
- # SYSLOG
- config_facts['syslog'] = array.get(syslogserver=True)['syslogserver']
- # Phonehome
- config_facts['phonehome'] = array.get(phonehome=True)['phonehome']
- # Proxy
- config_facts['proxy'] = array.get(proxy=True)['proxy']
- # Relay Host
- config_facts['relayhost'] = array.get(relayhost=True)['relayhost']
- # Sender Domain
- config_facts['senderdomain'] = array.get(senderdomain=True)['senderdomain']
- # SYSLOG
- config_facts['syslog'] = array.get(syslogserver=True)['syslogserver']
- # Idle Timeout
- config_facts['idle_timeout'] = array.get(idle_timeout=True)['idle_timeout']
- # SCSI Timeout
- config_facts['scsi_timeout'] = array.get(scsi_timeout=True)['scsi_timeout']
- # SSL
- config_facts['ssl_certs'] = array.get_certificate()
- # Global Admin settings
- if S3_REQUIRED_API_VERSION in api_version:
- config_facts['global_admin'] = array.get_global_admin_attributes()
- return config_facts
-
-
-def generate_admin_dict(array):
- api_version = array._list_available_rest_versions()
- admin_facts = {}
- if ADMIN_API_VERSION in api_version:
- admins = array.list_admins()
- for admin in range(0, len(admins)):
- admin_name = admins[admin]['name']
- admin_facts[admin_name] = {
- 'type': admins[admin]['type'],
- 'role': admins[admin]['role'],
- }
- return admin_facts
-
-
-def generate_subnet_dict(array):
- sub_facts = {}
- subnets = array.list_subnets()
- for sub in range(0, len(subnets)):
- sub_name = subnets[sub]['name']
- if subnets[sub]['enabled']:
- sub_facts[sub_name] = {
- 'gateway': subnets[sub]['gateway'],
- 'mtu': subnets[sub]['mtu'],
- 'vlan': subnets[sub]['vlan'],
- 'prefix': subnets[sub]['prefix'],
- 'interfaces': subnets[sub]['interfaces'],
- 'services': subnets[sub]['services'],
- }
- return sub_facts
-
-
-def generate_network_dict(array):
- net_facts = {}
- ports = array.list_network_interfaces()
- for port in range(0, len(ports)):
- int_name = ports[port]['name']
- net_facts[int_name] = {
- 'hwaddr': ports[port]['hwaddr'],
- 'mtu': ports[port]['mtu'],
- 'enabled': ports[port]['enabled'],
- 'speed': ports[port]['speed'],
- 'address': ports[port]['address'],
- 'slaves': ports[port]['slaves'],
- 'services': ports[port]['services'],
- 'gateway': ports[port]['gateway'],
- 'netmask': ports[port]['netmask'],
- }
- if ports[port]['subnet']:
- subnets = array.get_subnet(ports[port]['subnet'])
- if subnets['enabled']:
- net_facts[int_name]['subnet'] = {
- 'name': subnets['name'],
- 'prefix': subnets['prefix'],
- 'vlan': subnets['vlan'],
- }
- return net_facts
-
-
-def generate_capacity_dict(array):
- capacity_facts = {}
- api_version = array._list_available_rest_versions()
- if CAP_REQUIRED_API_VERSION in api_version:
- volumes = array.list_volumes(pending=True)
- capacity_facts['provisioned_space'] = sum(item['size'] for item in volumes)
- capacity = array.get(space=True)
- total_capacity = capacity[0]['capacity']
- used_space = capacity[0]["total"]
- capacity_facts['free_space'] = total_capacity - used_space
- capacity_facts['total_capacity'] = total_capacity
- capacity_facts['data_reduction'] = capacity[0]['data_reduction']
- capacity_facts['system_space'] = capacity[0]['system']
- capacity_facts['volume_space'] = capacity[0]['volumes']
- capacity_facts['shared_space'] = capacity[0]['shared_space']
- capacity_facts['snapshot_space'] = capacity[0]['snapshots']
- capacity_facts['thin_provisioning'] = capacity[0]['thin_provisioning']
- capacity_facts['total_reduction'] = capacity[0]['total_reduction']
-
- return capacity_facts
-
-
-def generate_snap_dict(array):
- snap_facts = {}
- snaps = array.list_volumes(snap=True)
- for snap in range(0, len(snaps)):
- snapshot = snaps[snap]['name']
- snap_facts[snapshot] = {
- 'size': snaps[snap]['size'],
- 'source': snaps[snap]['source'],
- 'created': snaps[snap]['created'],
- }
- return snap_facts
-
-
-def generate_vol_dict(array):
- volume_facts = {}
- vols = array.list_volumes()
- for vol in range(0, len(vols)):
- volume = vols[vol]['name']
- volume_facts[volume] = {
- 'source': vols[vol]['source'],
- 'size': vols[vol]['size'],
- 'serial': vols[vol]['serial'],
- 'hosts': [],
- 'bandwidth': ""
- }
- api_version = array._list_available_rest_versions()
- if AC_REQUIRED_API_VERSION in api_version:
- qvols = array.list_volumes(qos=True)
- for qvol in range(0, len(qvols)):
- volume = qvols[qvol]['name']
- qos = qvols[qvol]['bandwidth_limit']
- volume_facts[volume]['bandwidth'] = qos
- vvols = array.list_volumes(protocol_endpoint=True)
- for vvol in range(0, len(vvols)):
- volume = vvols[vvol]['name']
- volume_facts[volume] = {
- 'source': vvols[vvol]['source'],
- 'serial': vvols[vvol]['serial'],
- 'hosts': []
- }
- cvols = array.list_volumes(connect=True)
- for cvol in range(0, len(cvols)):
- volume = cvols[cvol]['name']
- voldict = [cvols[cvol]['host'], cvols[cvol]['lun']]
- volume_facts[volume]['hosts'].append(voldict)
- return volume_facts
-
-
-def generate_host_dict(array):
- api_version = array._list_available_rest_versions()
- host_facts = {}
- hosts = array.list_hosts()
- for host in range(0, len(hosts)):
- hostname = hosts[host]['name']
- tports = []
- host_all_info = array.get_host(hostname, all=True)
- if host_all_info:
- tports = host_all_info[0]['target_port']
- host_facts[hostname] = {
- 'hgroup': hosts[host]['hgroup'],
- 'iqn': hosts[host]['iqn'],
- 'wwn': hosts[host]['wwn'],
- 'personality': array.get_host(hostname,
- personality=True)['personality'],
- 'target_port': tports
- }
- if NVME_API_VERSION in api_version:
- host_facts[hostname]['nqn'] = hosts[host]['nqn']
- if PREFERRED_API_VERSION in api_version:
- hosts = array.list_hosts(preferred_array=True)
- for host in range(0, len(hosts)):
- hostname = hosts[host]['name']
- host_facts[hostname]['preferred_array'] = hosts[host]['preferred_array']
- return host_facts
-
-
-def generate_pgroups_dict(array):
- pgroups_facts = {}
- pgroups = array.list_pgroups()
- for pgroup in range(0, len(pgroups)):
- protgroup = pgroups[pgroup]['name']
- pgroups_facts[protgroup] = {
- 'hgroups': pgroups[pgroup]['hgroups'],
- 'hosts': pgroups[pgroup]['hosts'],
- 'source': pgroups[pgroup]['source'],
- 'targets': pgroups[pgroup]['targets'],
- 'volumes': pgroups[pgroup]['volumes'],
- }
- prot_sched = array.get_pgroup(protgroup, schedule=True)
- prot_reten = array.get_pgroup(protgroup, retention=True)
- if prot_sched['snap_enabled'] or prot_sched['replicate_enabled']:
- pgroups_facts[protgroup]['snap_freqyency'] = prot_sched['snap_frequency']
- pgroups_facts[protgroup]['replicate_freqyency'] = prot_sched['replicate_frequency']
- pgroups_facts[protgroup]['snap_enabled'] = prot_sched['snap_enabled']
- pgroups_facts[protgroup]['replicate_enabled'] = prot_sched['replicate_enabled']
- pgroups_facts[protgroup]['snap_at'] = prot_sched['snap_at']
- pgroups_facts[protgroup]['replicate_at'] = prot_sched['replicate_at']
- pgroups_facts[protgroup]['replicate_blackout'] = prot_sched['replicate_blackout']
- pgroups_facts[protgroup]['per_day'] = prot_reten['per_day']
- pgroups_facts[protgroup]['target_per_day'] = prot_reten['target_per_day']
- pgroups_facts[protgroup]['target_days'] = prot_reten['target_days']
- pgroups_facts[protgroup]['days'] = prot_reten['days']
- pgroups_facts[protgroup]['all_for'] = prot_reten['all_for']
- pgroups_facts[protgroup]['target_all_for'] = prot_reten['target_all_for']
- if ":" in protgroup:
- snap_transfers = array.get_pgroup(protgroup, snap=True, transfer=True)
- pgroups_facts[protgroup]['snaps'] = {}
- for snap_transfer in range(0, len(snap_transfers)):
- snap = snap_transfers[snap_transfer]['name']
- pgroups_facts[protgroup]['snaps'][snap] = {
- 'created': snap_transfers[snap_transfer]['created'],
- 'started': snap_transfers[snap_transfer]['started'],
- 'completed': snap_transfers[snap_transfer]['completed'],
- 'physical_bytes_written': snap_transfers[snap_transfer]['physical_bytes_written'],
- 'data_transferred': snap_transfers[snap_transfer]['data_transferred'],
- 'progress': snap_transfers[snap_transfer]['progress'],
- }
- return pgroups_facts
-
-
-def generate_pods_dict(array):
- pods_facts = {}
- api_version = array._list_available_rest_versions()
- if AC_REQUIRED_API_VERSION in api_version:
- pods = array.list_pods()
- for pod in range(0, len(pods)):
- acpod = pods[pod]['name']
- pods_facts[acpod] = {
- 'source': pods[pod]['source'],
- 'arrays': pods[pod]['arrays'],
- }
- return pods_facts
-
-
-def generate_conn_array_dict(array):
- conn_array_facts = {}
- api_version = array._list_available_rest_versions()
- if CONN_STATUS_API_VERSION in api_version:
- carrays = array.list_connected_arrays()
- for carray in range(0, len(carrays)):
- arrayname = carrays[carray]['array_name']
- conn_array_facts[arrayname] = {
- 'array_id': carrays[carray]['id'],
- 'throtled': carrays[carray]['throtled'],
- 'version': carrays[carray]['version'],
- 'type': carrays[carray]['type'],
- 'mgmt_ip': carrays[carray]['management_address'],
- 'repl_ip': carrays[carray]['replication_address'],
- }
- if CONN_STATUS_API_VERSION in api_version:
- conn_array_facts[arrayname]['status'] = carrays[carray]['status']
- return conn_array_facts
-
-
-def generate_apps_dict(array):
- apps_facts = {}
- api_version = array._list_available_rest_versions()
- if SAN_REQUIRED_API_VERSION in api_version:
- apps = array.list_apps()
- for app in range(0, len(apps)):
- appname = apps[app]['name']
- apps_facts[appname] = {
- 'version': apps[app]['version'],
- 'status': apps[app]['status'],
- 'description': apps[app]['description'],
- }
- return apps_facts
-
-
-def generate_vgroups_dict(array):
- vgroups_facts = {}
- api_version = array._list_available_rest_versions()
- if AC_REQUIRED_API_VERSION in api_version:
- vgroups = array.list_vgroups()
- for vgroup in range(0, len(vgroups)):
- virtgroup = vgroups[vgroup]['name']
- vgroups_facts[virtgroup] = {
- 'volumes': vgroups[vgroup]['volumes'],
- }
- return vgroups_facts
-
-
-def generate_nfs_offload_dict(array):
- offload_facts = {}
- api_version = array._list_available_rest_versions()
- if AC_REQUIRED_API_VERSION in api_version:
- offload = array.list_nfs_offload()
- for target in range(0, len(offload)):
- offloadt = offload[target]['name']
- offload_facts[offloadt] = {
- 'status': offload[target]['status'],
- 'mount_point': offload[target]['mount_point'],
- 'protocol': offload[target]['protocol'],
- 'mount_options': offload[target]['mount_options'],
- 'address': offload[target]['address'],
- }
- return offload_facts
-
-
-def generate_s3_offload_dict(array):
- offload_facts = {}
- api_version = array._list_available_rest_versions()
- if S3_REQUIRED_API_VERSION in api_version:
- offload = array.list_s3_offload()
- for target in range(0, len(offload)):
- offloadt = offload[target]['name']
- offload_facts[offloadt] = {
- 'status': offload[target]['status'],
- 'bucket': offload[target]['bucket'],
- 'protocol': offload[target]['protocol'],
- 'access_key_id': offload[target]['access_key_id'],
- }
- return offload_facts
-
-
-def generate_hgroups_dict(array):
- hgroups_facts = {}
- hgroups = array.list_hgroups()
- for hgroup in range(0, len(hgroups)):
- hostgroup = hgroups[hgroup]['name']
- hgroups_facts[hostgroup] = {
- 'hosts': hgroups[hgroup]['hosts'],
- 'pgs': [],
- 'vols': [],
- }
- pghgroups = array.list_hgroups(protect=True)
- for pghg in range(0, len(pghgroups)):
- pgname = pghgroups[pghg]['name']
- hgroups_facts[pgname]['pgs'].append(pghgroups[pghg]['protection_group'])
- volhgroups = array.list_hgroups(connect=True)
- for pgvol in range(0, len(volhgroups)):
- pgname = volhgroups[pgvol]['name']
- volpgdict = [volhgroups[pgvol]['vol'], volhgroups[pgvol]['lun']]
- hgroups_facts[pgname]['vols'].append(volpgdict)
- return hgroups_facts
-
-
-def generate_interfaces_dict(array):
- api_version = array._list_available_rest_versions()
- int_facts = {}
- ports = array.list_ports()
- for port in range(0, len(ports)):
- int_name = ports[port]['name']
- if ports[port]['wwn']:
- int_facts[int_name] = ports[port]['wwn']
- if ports[port]['iqn']:
- int_facts[int_name] = ports[port]['iqn']
- if NVME_API_VERSION in api_version:
- if ports[port]['nqn']:
- int_facts[int_name] = ports[port]['nqn']
- return int_facts
-
-
-def main():
- argument_spec = purefa_argument_spec()
- argument_spec.update(dict(
- gather_subset=dict(default='minimum', type='list',)
- ))
-
- module = AnsibleModule(argument_spec, supports_check_mode=False)
-
- array = get_system(module)
-
- subset = [test.lower() for test in module.params['gather_subset']]
- valid_subsets = ('all', 'minimum', 'config', 'performance', 'capacity',
- 'network', 'subnet', 'interfaces', 'hgroups', 'pgroups',
- 'hosts', 'admins', 'volumes', 'snapshots', 'pods',
- 'vgroups', 'offload', 'apps', 'arrays')
- subset_test = (test in valid_subsets for test in subset)
- if not all(subset_test):
- module.fail_json(msg="value must gather_subset must be one or more of: %s, got: %s"
- % (",".join(valid_subsets), ",".join(subset)))
-
- facts = {}
-
- if 'minimum' in subset or 'all' in subset:
- facts['default'] = generate_default_dict(array)
- if 'performance' in subset or 'all' in subset:
- facts['performance'] = generate_perf_dict(array)
- if 'config' in subset or 'all' in subset:
- facts['config'] = generate_config_dict(array)
- if 'capacity' in subset or 'all' in subset:
- facts['capacity'] = generate_capacity_dict(array)
- if 'network' in subset or 'all' in subset:
- facts['network'] = generate_network_dict(array)
- if 'subnet' in subset or 'all' in subset:
- facts['subnet'] = generate_subnet_dict(array)
- if 'interfaces' in subset or 'all' in subset:
- facts['interfaces'] = generate_interfaces_dict(array)
- if 'hosts' in subset or 'all' in subset:
- facts['hosts'] = generate_host_dict(array)
- if 'volumes' in subset or 'all' in subset:
- facts['volumes'] = generate_vol_dict(array)
- if 'snapshots' in subset or 'all' in subset:
- facts['snapshots'] = generate_snap_dict(array)
- if 'hgroups' in subset or 'all' in subset:
- facts['hgroups'] = generate_hgroups_dict(array)
- if 'pgroups' in subset or 'all' in subset:
- facts['pgroups'] = generate_pgroups_dict(array)
- if 'pods' in subset or 'all' in subset:
- facts['pods'] = generate_pods_dict(array)
- if 'admins' in subset or 'all' in subset:
- facts['admins'] = generate_admin_dict(array)
- if 'vgroups' in subset or 'all' in subset:
- facts['vgroups'] = generate_vgroups_dict(array)
- if 'offload' in subset or 'all' in subset:
- facts['nfs_offload'] = generate_nfs_offload_dict(array)
- facts['s3_offload'] = generate_s3_offload_dict(array)
- if 'apps' in subset or 'all' in subset:
- facts['apps'] = generate_apps_dict(array)
- if 'arrays' in subset or 'all' in subset:
- facts['arrays'] = generate_conn_array_dict(array)
-
- module.exit_json(ansible_facts={'ansible_purefa_facts': facts})
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/storage/purestorage/purefb_facts.py b/plugins/modules/storage/purestorage/purefb_facts.py
deleted file mode 100644
index 8c5a40c0dc..0000000000
--- a/plugins/modules/storage/purestorage/purefb_facts.py
+++ /dev/null
@@ -1,652 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-# (c) 2018, Simon Dodsley (simon@purestorage.com)
-# 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
-
-DOCUMENTATION = r'''
----
-module: purefb_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favor of C(_info) module.
- alternative: Use M(purestorage.flashblade.purefb_info) instead.
-short_description: Collect facts from Pure Storage FlashBlade
-description:
- - Collect facts information from a Pure Storage FlashBlade running the
- Purity//FB operating system. By default, the module will collect basic
- fact information including hosts, host groups, protection
- groups and volume counts. Additional fact information can be collected
- based on the configured set of arguments.
-author:
- - Pure Storage Ansible Team (@sdodsley)
-options:
- gather_subset:
- description:
- - When supplied, this argument will define the facts to be collected.
- Possible values for this include all, minimum, config, performance,
- capacity, network, subnets, lags, filesystems and snapshots.
- required: false
- type: list
- default: minimum
-extends_documentation_fragment:
-- community.general.purestorage.fb
-
-'''
-
-EXAMPLES = r'''
-- name: Collect default set of facts
- community.general.purefb_facts:
- fb_url: 10.10.10.2
- api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641
-
-- name: Collect configuration and capacity facts
- community.general.purefb_facts:
- gather_subset:
- - config
- - capacity
- fb_url: 10.10.10.2
- api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641
-
-- name: Collect all facts
- community.general.purefb_facts:
- gather_subset:
- - all
- fb_url: 10.10.10.2
- api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641
-'''
-
-RETURN = r'''
-ansible_facts:
- description: Returns the facts collected from the FlashBlade
- returned: always
- type: complex
- sample: {
- "capacity": {
- "aggregate": {
- "data_reduction": 1.1179228,
- "snapshots": 0,
- "total_physical": 17519748439,
- "unique": 17519748439,
- "virtual": 19585726464
- },
- "file-system": {
- "data_reduction": 1.3642412,
- "snapshots": 0,
- "total_physical": 4748219708,
- "unique": 4748219708,
- "virtual": 6477716992
- },
- "object-store": {
- "data_reduction": 1.0263462,
- "snapshots": 0,
- "total_physical": 12771528731,
- "unique": 12771528731,
- "virtual": 6477716992
- },
- "total": 83359896948925
- },
- "config": {
- "alert_watchers": {
- "enabled": true,
- "name": "notify@acmestorage.com"
- },
- "array_management": {
- "base_dn": null,
- "bind_password": null,
- "bind_user": null,
- "enabled": false,
- "name": "management",
- "services": [
- "management"
- ],
- "uris": []
- },
- "directory_service_roles": {
- "array_admin": {
- "group": null,
- "group_base": null
- },
- "ops_admin": {
- "group": null,
- "group_base": null
- },
- "readonly": {
- "group": null,
- "group_base": null
- },
- "storage_admin": {
- "group": null,
- "group_base": null
- }
- },
- "dns": {
- "domain": "demo.acmestorage.com",
- "name": "demo-fb-1",
- "nameservers": [
- "8.8.8.8"
- ],
- "search": [
- "demo.acmestorage.com"
- ]
- },
- "nfs_directory_service": {
- "base_dn": null,
- "bind_password": null,
- "bind_user": null,
- "enabled": false,
- "name": "nfs",
- "services": [
- "nfs"
- ],
- "uris": []
- },
- "ntp": [
- "0.ntp.pool.org"
- ],
- "smb_directory_service": {
- "base_dn": null,
- "bind_password": null,
- "bind_user": null,
- "enabled": false,
- "name": "smb",
- "services": [
- "smb"
- ],
- "uris": []
- },
- "smtp": {
- "name": "demo-fb-1",
- "relay_host": null,
- "sender_domain": "acmestorage.com"
- },
- "ssl_certs": {
- "certificate": "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----",
- "common_name": "Acme Storage",
- "country": "US",
- "email": null,
- "intermediate_certificate": null,
- "issued_by": "Acme Storage",
- "issued_to": "Acme Storage",
- "key_size": 4096,
- "locality": null,
- "name": "global",
- "organization": "Acme Storage",
- "organizational_unit": "Acme Storage",
- "passphrase": null,
- "private_key": null,
- "state": null,
- "status": "self-signed",
- "valid_from": "1508433967000",
- "valid_to": "2458833967000"
- }
- },
- "default": {
- "blades": 15,
- "buckets": 7,
- "filesystems": 2,
- "flashblade_name": "demo-fb-1",
- "object_store_accounts": 1,
- "object_store_users": 1,
- "purity_version": "2.2.0",
- "snapshots": 1,
- "total_capacity": 83359896948925
- },
- "filesystems": {
- "k8s-pvc-d24b1357-579e-11e8-811f-ecf4bbc88f54": {
- "destroyed": false,
- "fast_remove": false,
- "hard_limit": true,
- "nfs_rules": "*(rw,no_root_squash)",
- "provisioned": 21474836480,
- "snapshot_enabled": false
- },
- "z": {
- "destroyed": false,
- "fast_remove": false,
- "hard_limit": false,
- "provisioned": 1073741824,
- "snapshot_enabled": false
- }
- },
- "lag": {
- "uplink": {
- "lag_speed": 0,
- "port_speed": 40000000000,
- "ports": [
- {
- "name": "CH1.FM1.ETH1.1"
- },
- {
- "name": "CH1.FM1.ETH1.2"
- },
- ],
- "status": "healthy"
- }
- },
- "network": {
- "fm1.admin0": {
- "address": "10.10.100.6",
- "gateway": "10.10.100.1",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "services": [
- "support"
- ],
- "type": "vip",
- "vlan": 2200
- },
- "fm2.admin0": {
- "address": "10.10.100.7",
- "gateway": "10.10.100.1",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "services": [
- "support"
- ],
- "type": "vip",
- "vlan": 2200
- },
- "nfs1": {
- "address": "10.10.100.4",
- "gateway": "10.10.100.1",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "services": [
- "data"
- ],
- "type": "vip",
- "vlan": 2200
- },
- "vir0": {
- "address": "10.10.100.5",
- "gateway": "10.10.100.1",
- "mtu": 1500,
- "netmask": "255.255.255.0",
- "services": [
- "management"
- ],
- "type": "vip",
- "vlan": 2200
- }
- },
- "performance": {
- "aggregate": {
- "bytes_per_op": 0,
- "bytes_per_read": 0,
- "bytes_per_write": 0,
- "read_bytes_per_sec": 0,
- "reads_per_sec": 0,
- "usec_per_other_op": 0,
- "usec_per_read_op": 0,
- "usec_per_write_op": 0,
- "write_bytes_per_sec": 0,
- "writes_per_sec": 0
- },
- "http": {
- "bytes_per_op": 0,
- "bytes_per_read": 0,
- "bytes_per_write": 0,
- "read_bytes_per_sec": 0,
- "reads_per_sec": 0,
- "usec_per_other_op": 0,
- "usec_per_read_op": 0,
- "usec_per_write_op": 0,
- "write_bytes_per_sec": 0,
- "writes_per_sec": 0
- },
- "nfs": {
- "bytes_per_op": 0,
- "bytes_per_read": 0,
- "bytes_per_write": 0,
- "read_bytes_per_sec": 0,
- "reads_per_sec": 0,
- "usec_per_other_op": 0,
- "usec_per_read_op": 0,
- "usec_per_write_op": 0,
- "write_bytes_per_sec": 0,
- "writes_per_sec": 0
- },
- "s3": {
- "bytes_per_op": 0,
- "bytes_per_read": 0,
- "bytes_per_write": 0,
- "read_bytes_per_sec": 0,
- "reads_per_sec": 0,
- "usec_per_other_op": 0,
- "usec_per_read_op": 0,
- "usec_per_write_op": 0,
- "write_bytes_per_sec": 0,
- "writes_per_sec": 0
- }
- },
- "snapshots": {
- "z.188": {
- "destroyed": false,
- "source": "z",
- "source_destroyed": false,
- "suffix": "188"
- }
- },
- "subnet": {
- "new-mgmt": {
- "gateway": "10.10.100.1",
- "interfaces": [
- {
- "name": "fm1.admin0"
- },
- {
- "name": "fm2.admin0"
- },
- {
- "name": "nfs1"
- },
- {
- "name": "vir0"
- }
- ],
- "lag": "uplink",
- "mtu": 1500,
- "prefix": "10.10.100.0/24",
- "services": [
- "data",
- "management",
- "support"
- ],
- "vlan": 2200
- }
- }
- }
-'''
-
-
-from ansible.module_utils.basic import AnsibleModule
-from ansible_collections.community.general.plugins.module_utils.pure import get_blade, purefb_argument_spec
-
-
-MIN_REQUIRED_API_VERSION = '1.3'
-HARD_LIMIT_API_VERSION = '1.4'
-
-
-def generate_default_dict(blade):
- default_facts = {}
- defaults = blade.arrays.list_arrays().items[0]
- default_facts['flashblade_name'] = defaults.name
- default_facts['purity_version'] = defaults.version
- default_facts['filesystems'] = \
- len(blade.file_systems.list_file_systems().items)
- default_facts['snapshots'] = \
- len(blade.file_system_snapshots.list_file_system_snapshots().items)
- default_facts['buckets'] = len(blade.buckets.list_buckets().items)
- default_facts['object_store_users'] = \
- len(blade.object_store_users.list_object_store_users().items)
- default_facts['object_store_accounts'] = \
- len(blade.object_store_accounts.list_object_store_accounts().items)
- default_facts['blades'] = len(blade.blade.list_blades().items)
- default_facts['total_capacity'] = \
- blade.arrays.list_arrays_space().items[0].capacity
- return default_facts
-
-
-def generate_perf_dict(blade):
- perf_facts = {}
- total_perf = blade.arrays.list_arrays_performance()
- http_perf = blade.arrays.list_arrays_performance(protocol='http')
- s3_perf = blade.arrays.list_arrays_performance(protocol='s3')
- nfs_perf = blade.arrays.list_arrays_performance(protocol='nfs')
- perf_facts['aggregate'] = {
- 'bytes_per_op': total_perf.items[0].bytes_per_op,
- 'bytes_per_read': total_perf.items[0].bytes_per_read,
- 'bytes_per_write': total_perf.items[0].bytes_per_write,
- 'read_bytes_per_sec': total_perf.items[0].read_bytes_per_sec,
- 'reads_per_sec': total_perf.items[0].reads_per_sec,
- 'usec_per_other_op': total_perf.items[0].usec_per_other_op,
- 'usec_per_read_op': total_perf.items[0].usec_per_read_op,
- 'usec_per_write_op': total_perf.items[0].usec_per_write_op,
- 'write_bytes_per_sec': total_perf.items[0].write_bytes_per_sec,
- 'writes_per_sec': total_perf.items[0].writes_per_sec,
- }
- perf_facts['http'] = {
- 'bytes_per_op': http_perf.items[0].bytes_per_op,
- 'bytes_per_read': http_perf.items[0].bytes_per_read,
- 'bytes_per_write': http_perf.items[0].bytes_per_write,
- 'read_bytes_per_sec': http_perf.items[0].read_bytes_per_sec,
- 'reads_per_sec': http_perf.items[0].reads_per_sec,
- 'usec_per_other_op': http_perf.items[0].usec_per_other_op,
- 'usec_per_read_op': http_perf.items[0].usec_per_read_op,
- 'usec_per_write_op': http_perf.items[0].usec_per_write_op,
- 'write_bytes_per_sec': http_perf.items[0].write_bytes_per_sec,
- 'writes_per_sec': http_perf.items[0].writes_per_sec,
- }
- perf_facts['s3'] = {
- 'bytes_per_op': s3_perf.items[0].bytes_per_op,
- 'bytes_per_read': s3_perf.items[0].bytes_per_read,
- 'bytes_per_write': s3_perf.items[0].bytes_per_write,
- 'read_bytes_per_sec': s3_perf.items[0].read_bytes_per_sec,
- 'reads_per_sec': s3_perf.items[0].reads_per_sec,
- 'usec_per_other_op': s3_perf.items[0].usec_per_other_op,
- 'usec_per_read_op': s3_perf.items[0].usec_per_read_op,
- 'usec_per_write_op': s3_perf.items[0].usec_per_write_op,
- 'write_bytes_per_sec': s3_perf.items[0].write_bytes_per_sec,
- 'writes_per_sec': s3_perf.items[0].writes_per_sec,
- }
- perf_facts['nfs'] = {
- 'bytes_per_op': nfs_perf.items[0].bytes_per_op,
- 'bytes_per_read': nfs_perf.items[0].bytes_per_read,
- 'bytes_per_write': nfs_perf.items[0].bytes_per_write,
- 'read_bytes_per_sec': nfs_perf.items[0].read_bytes_per_sec,
- 'reads_per_sec': nfs_perf.items[0].reads_per_sec,
- 'usec_per_other_op': nfs_perf.items[0].usec_per_other_op,
- 'usec_per_read_op': nfs_perf.items[0].usec_per_read_op,
- 'usec_per_write_op': nfs_perf.items[0].usec_per_write_op,
- 'write_bytes_per_sec': nfs_perf.items[0].write_bytes_per_sec,
- 'writes_per_sec': nfs_perf.items[0].writes_per_sec,
- }
-
- return perf_facts
-
-
-def generate_config_dict(blade):
- config_facts = {}
- config_facts['dns'] = blade.dns.list_dns().items[0].to_dict()
- config_facts['smtp'] = blade.smtp.list_smtp().items[0].to_dict()
- config_facts['alert_watchers'] = \
- blade.alert_watchers.list_alert_watchers().items[0].to_dict()
- api_version = blade.api_version.list_versions().versions
- if HARD_LIMIT_API_VERSION in api_version:
- config_facts['array_management'] = \
- blade.directory_services.list_directory_services(names=['management']).items[0].to_dict()
- config_facts['directory_service_roles'] = {}
- roles = blade.directory_services.list_directory_services_roles()
- for role in range(0, len(roles.items)):
- role_name = roles.items[role].name
- config_facts['directory_service_roles'][role_name] = {
- 'group': roles.items[role].group,
- 'group_base': roles.items[role].group_base
- }
- config_facts['nfs_directory_service'] = \
- blade.directory_services.list_directory_services(names=['nfs']).items[0].to_dict()
- config_facts['smb_directory_service'] = \
- blade.directory_services.list_directory_services(names=['smb']).items[0].to_dict()
- config_facts['ntp'] = blade.arrays.list_arrays().items[0].ntp_servers
- config_facts['ssl_certs'] = \
- blade.certificates.list_certificates().items[0].to_dict()
- return config_facts
-
-
-def generate_subnet_dict(blade):
- sub_facts = {}
- subnets = blade.subnets.list_subnets()
- for sub in range(0, len(subnets.items)):
- sub_name = subnets.items[sub].name
- if subnets.items[sub].enabled:
- sub_facts[sub_name] = {
- 'gateway': subnets.items[sub].gateway,
- 'mtu': subnets.items[sub].mtu,
- 'vlan': subnets.items[sub].vlan,
- 'prefix': subnets.items[sub].prefix,
- 'services': subnets.items[sub].services,
- }
- sub_facts[sub_name]['lag'] = subnets.items[sub].link_aggregation_group.name
- sub_facts[sub_name]['interfaces'] = []
- for iface in range(0, len(subnets.items[sub].interfaces)):
- sub_facts[sub_name]['interfaces'].append({'name': subnets.items[sub].interfaces[iface].name})
- return sub_facts
-
-
-def generate_lag_dict(blade):
- lag_facts = {}
- groups = blade.link_aggregation_groups.list_link_aggregation_groups()
- for groupcnt in range(0, len(groups.items)):
- lag_name = groups.items[groupcnt].name
- lag_facts[lag_name] = {
- 'lag_speed': groups.items[groupcnt].lag_speed,
- 'port_speed': groups.items[groupcnt].port_speed,
- 'status': groups.items[groupcnt].status,
- }
- lag_facts[lag_name]['ports'] = []
- for port in range(0, len(groups.items[groupcnt].ports)):
- lag_facts[lag_name]['ports'].append({'name': groups.items[groupcnt].ports[port].name})
- return lag_facts
-
-
-def generate_network_dict(blade):
- net_facts = {}
- ports = blade.network_interfaces.list_network_interfaces()
- for portcnt in range(0, len(ports.items)):
- int_name = ports.items[portcnt].name
- if ports.items[portcnt].enabled:
- net_facts[int_name] = {
- 'type': ports.items[portcnt].type,
- 'mtu': ports.items[portcnt].mtu,
- 'vlan': ports.items[portcnt].vlan,
- 'address': ports.items[portcnt].address,
- 'services': ports.items[portcnt].services,
- 'gateway': ports.items[portcnt].gateway,
- 'netmask': ports.items[portcnt].netmask,
- }
- return net_facts
-
-
-def generate_capacity_dict(blade):
- capacity_facts = {}
- total_cap = blade.arrays.list_arrays_space()
- file_cap = blade.arrays.list_arrays_space(type='file-system')
- object_cap = blade.arrays.list_arrays_space(type='object-store')
- capacity_facts['total'] = total_cap.items[0].capacity
- capacity_facts['aggregate'] = {
- 'data_reduction': total_cap.items[0].space.data_reduction,
- 'snapshots': total_cap.items[0].space.snapshots,
- 'total_physical': total_cap.items[0].space.total_physical,
- 'unique': total_cap.items[0].space.unique,
- 'virtual': total_cap.items[0].space.virtual,
- }
- capacity_facts['file-system'] = {
- 'data_reduction': file_cap.items[0].space.data_reduction,
- 'snapshots': file_cap.items[0].space.snapshots,
- 'total_physical': file_cap.items[0].space.total_physical,
- 'unique': file_cap.items[0].space.unique,
- 'virtual': file_cap.items[0].space.virtual,
- }
- capacity_facts['object-store'] = {
- 'data_reduction': object_cap.items[0].space.data_reduction,
- 'snapshots': object_cap.items[0].space.snapshots,
- 'total_physical': object_cap.items[0].space.total_physical,
- 'unique': object_cap.items[0].space.unique,
- 'virtual': file_cap.items[0].space.virtual,
- }
-
- return capacity_facts
-
-
-def generate_snap_dict(blade):
- snap_facts = {}
- snaps = blade.file_system_snapshots.list_file_system_snapshots()
- for snap in range(0, len(snaps.items)):
- snapshot = snaps.items[snap].name
- snap_facts[snapshot] = {
- 'destroyed': snaps.items[snap].destroyed,
- 'source': snaps.items[snap].source,
- 'suffix': snaps.items[snap].suffix,
- 'source_destroyed': snaps.items[snap].source_destroyed,
- }
- return snap_facts
-
-
-def generate_fs_dict(blade):
- fs_facts = {}
- fsys = blade.file_systems.list_file_systems()
- for fsystem in range(0, len(fsys.items)):
- share = fsys.items[fsystem].name
- fs_facts[share] = {
- 'fast_remove': fsys.items[fsystem].fast_remove_directory_enabled,
- 'snapshot_enabled': fsys.items[fsystem].snapshot_directory_enabled,
- 'provisioned': fsys.items[fsystem].provisioned,
- 'destroyed': fsys.items[fsystem].destroyed,
- }
- if fsys.items[fsystem].http.enabled:
- fs_facts[share]['http'] = fsys.items[fsystem].http.enabled
- if fsys.items[fsystem].smb.enabled:
- fs_facts[share]['smb_mode'] = fsys.items[fsystem].smb.acl_mode
- if fsys.items[fsystem].nfs.enabled:
- fs_facts[share]['nfs_rules'] = fsys.items[fsystem].nfs.rules
- api_version = blade.api_version.list_versions().versions
- if HARD_LIMIT_API_VERSION in api_version:
- fs_facts[share]['hard_limit'] = fsys.items[fsystem].hard_limit_enabled
-
- return fs_facts
-
-
-def main():
- argument_spec = purefb_argument_spec()
- argument_spec.update(dict(
- gather_subset=dict(default='minimum', type='list',)
- ))
-
- module = AnsibleModule(argument_spec, supports_check_mode=True)
-
- blade = get_blade(module)
- versions = blade.api_version.list_versions().versions
-
- if MIN_REQUIRED_API_VERSION not in versions:
- module.fail_json(msg='FlashBlade REST version not supported. Minimum version required: {0}'.format(MIN_REQUIRED_API_VERSION))
-
- subset = [test.lower() for test in module.params['gather_subset']]
- valid_subsets = ('all', 'minimum', 'config', 'performance', 'capacity',
- 'network', 'subnets', 'lags',
- 'filesystems', 'snapshots')
- subset_test = (test in valid_subsets for test in subset)
- if not all(subset_test):
- module.fail_json(msg="value must gather_subset must be one or more of: %s, got: %s"
- % (",".join(valid_subsets), ",".join(subset)))
-
- facts = {}
-
- if 'minimum' in subset or 'all' in subset:
- facts['default'] = generate_default_dict(blade)
- if 'performance' in subset or 'all' in subset:
- facts['performance'] = generate_perf_dict(blade)
- if 'config' in subset or 'all' in subset:
- facts['config'] = generate_config_dict(blade)
- if 'capacity' in subset or 'all' in subset:
- facts['capacity'] = generate_capacity_dict(blade)
- if 'lags' in subset or 'all' in subset:
- facts['lag'] = generate_lag_dict(blade)
- if 'network' in subset or 'all' in subset:
- facts['network'] = generate_network_dict(blade)
- if 'subnets' in subset or 'all' in subset:
- facts['subnet'] = generate_subnet_dict(blade)
- if 'filesystems' in subset or 'all' in subset:
- facts['filesystems'] = generate_fs_dict(blade)
- if 'snapshots' in subset or 'all' in subset:
- facts['snapshots'] = generate_snap_dict(blade)
-
- module.exit_json(ansible_facts={'ansible_purefb_facts': facts})
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/system/python_requirements_facts.py b/plugins/modules/system/python_requirements_facts.py
deleted file mode 120000
index d816829034..0000000000
--- a/plugins/modules/system/python_requirements_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-python_requirements_info.py
\ No newline at end of file
diff --git a/plugins/modules/system/python_requirements_info.py b/plugins/modules/system/python_requirements_info.py
index 5ffb277612..08a9ddd64e 100644
--- a/plugins/modules/system/python_requirements_info.py
+++ b/plugins/modules/system/python_requirements_info.py
@@ -113,9 +113,6 @@ def main():
),
supports_check_mode=True,
)
- if module._name in ('python_requirements_facts', 'community.general.python_requirements_facts'):
- module.deprecate("The 'python_requirements_facts' module has been renamed to 'python_requirements_info'",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
if not HAS_DISTUTILS:
module.fail_json(
msg='Could not import "distutils" and "pkg_resources" libraries to introspect python environment.',
diff --git a/plugins/modules/vertica_facts.py b/plugins/modules/vertica_facts.py
deleted file mode 120000
index f98801c7ad..0000000000
--- a/plugins/modules/vertica_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-database/vertica/vertica_facts.py
\ No newline at end of file
diff --git a/plugins/modules/web_infrastructure/jenkins_job_facts.py b/plugins/modules/web_infrastructure/jenkins_job_facts.py
deleted file mode 120000
index 7a78b2faee..0000000000
--- a/plugins/modules/web_infrastructure/jenkins_job_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-jenkins_job_info.py
\ No newline at end of file
diff --git a/plugins/modules/web_infrastructure/jenkins_job_info.py b/plugins/modules/web_infrastructure/jenkins_job_info.py
index f0d13262b0..c927e5b954 100644
--- a/plugins/modules/web_infrastructure/jenkins_job_info.py
+++ b/plugins/modules/web_infrastructure/jenkins_job_info.py
@@ -237,9 +237,6 @@ def main():
],
supports_check_mode=True,
)
- if module._name in ('jenkins_job_facts', 'community.general.jenkins_job_facts'):
- module.deprecate("The 'jenkins_job_facts' module has been renamed to 'jenkins_job_info'",
- version='3.0.0', collection_name='community.general') # was Ansible 2.13
test_dependencies(module)
jobs = list()
diff --git a/plugins/modules/web_infrastructure/nginx_status_facts.py b/plugins/modules/web_infrastructure/nginx_status_facts.py
deleted file mode 100644
index 3a68f8da99..0000000000
--- a/plugins/modules/web_infrastructure/nginx_status_facts.py
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# (c) 2016, René Moser
-# 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
-
-
-DOCUMENTATION = '''
----
-module: nginx_status_facts
-deprecated:
- removed_in: 3.0.0 # was Ansible 2.13
- why: Deprecated in favour of C(_info) module.
- alternative: Use M(community.general.nginx_status_info) instead.
-short_description: Retrieve nginx status facts.
-description:
- - Gathers facts from nginx from an URL having C(stub_status) enabled.
-author: "René Moser (@resmo)"
-options:
- url:
- type: str
- description:
- - URL of the nginx status.
- required: true
- timeout:
- type: int
- description:
- - HTTP connection timeout in seconds.
- required: false
- default: 10
-
-notes:
- - See http://nginx.org/en/docs/http/ngx_http_stub_status_module.html for more information.
-'''
-
-EXAMPLES = '''
-# Gather status facts from nginx on localhost
-- name: Get current http stats
- community.general.nginx_status_facts:
- url: http://localhost/nginx_status
-
-# Gather status facts from nginx on localhost with a custom timeout of 20 seconds
-- name: Get current http stats
- community.general.nginx_status_facts:
- url: http://localhost/nginx_status
- timeout: 20
-'''
-
-RETURN = '''
----
-nginx_status_facts.active_connections:
- description: Active connections.
- returned: success
- type: int
- sample: 2340
-nginx_status_facts.accepts:
- description: The total number of accepted client connections.
- returned: success
- type: int
- sample: 81769947
-nginx_status_facts.handled:
- description: The total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have been reached.
- returned: success
- type: int
- sample: 81769947
-nginx_status_facts.requests:
- description: The total number of client requests.
- returned: success
- type: int
- sample: 144332345
-nginx_status_facts.reading:
- description: The current number of connections where nginx is reading the request header.
- returned: success
- type: int
- sample: 0
-nginx_status_facts.writing:
- description: The current number of connections where nginx is writing the response back to the client.
- returned: success
- type: int
- sample: 241
-nginx_status_facts.waiting:
- description: The current number of idle client connections waiting for a request.
- returned: success
- type: int
- sample: 2092
-nginx_status_facts.data:
- description: HTTP response as is.
- returned: success
- type: str
- sample: "Active connections: 2340 \nserver accepts handled requests\n 81769947 81769947 144332345 \nReading: 0 Writing: 241 Waiting: 2092 \n"
-'''
-
-import re
-from ansible.module_utils.basic import AnsibleModule
-from ansible.module_utils.urls import fetch_url
-from ansible.module_utils._text import to_text
-
-
-class NginxStatusFacts(object):
-
- def __init__(self):
- self.url = module.params.get('url')
- self.timeout = module.params.get('timeout')
-
- def run(self):
- result = {
- 'nginx_status_facts': {
- 'active_connections': None,
- 'accepts': None,
- 'handled': None,
- 'requests': None,
- 'reading': None,
- 'writing': None,
- 'waiting': None,
- 'data': None,
- }
- }
- (response, info) = fetch_url(module=module, url=self.url, force=True, timeout=self.timeout)
- if not response:
- module.fail_json(msg="No valid or no response from url %s within %s seconds (timeout)" % (self.url, self.timeout))
-
- data = to_text(response.read(), errors='surrogate_or_strict')
- if not data:
- return result
-
- result['nginx_status_facts']['data'] = data
- expr = r'Active connections: ([0-9]+) \nserver accepts handled requests\n ([0-9]+) ([0-9]+) ([0-9]+) \n' \
- r'Reading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)'
- match = re.match(expr, data, re.S)
- if match:
- result['nginx_status_facts']['active_connections'] = int(match.group(1))
- result['nginx_status_facts']['accepts'] = int(match.group(2))
- result['nginx_status_facts']['handled'] = int(match.group(3))
- result['nginx_status_facts']['requests'] = int(match.group(4))
- result['nginx_status_facts']['reading'] = int(match.group(5))
- result['nginx_status_facts']['writing'] = int(match.group(6))
- result['nginx_status_facts']['waiting'] = int(match.group(7))
- return result
-
-
-def main():
- global module
- module = AnsibleModule(
- argument_spec=dict(
- url=dict(required=True),
- timeout=dict(type='int', default=10),
- ),
- supports_check_mode=True,
- )
-
- nginx_status_facts = NginxStatusFacts().run()
- result = dict(changed=False, ansible_facts=nginx_status_facts)
- module.exit_json(**result)
-
-
-if __name__ == '__main__':
- main()
diff --git a/plugins/modules/xenserver_guest_facts.py b/plugins/modules/xenserver_guest_facts.py
deleted file mode 120000
index 23d0dde0aa..0000000000
--- a/plugins/modules/xenserver_guest_facts.py
+++ /dev/null
@@ -1 +0,0 @@
-cloud/xenserver/xenserver_guest_facts.py
\ No newline at end of file
diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt
index e3f5531991..582f2dc2fb 100644
--- a/tests/sanity/ignore-2.10.txt
+++ b/tests/sanity/ignore-2.10.txt
@@ -9,78 +9,19 @@ plugins/modules/cloud/linode/linode.py validate-modules:undocumented-parameter
plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path
plugins/modules/cloud/lxc/lxc_container.py validate-modules:use-run-command-not-popen
plugins/modules/cloud/misc/rhevm.py validate-modules:parameter-state-invalid-choice
-plugins/modules/cloud/online/online_server_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/online/online_server_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/online/online_user_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/online/online_user_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_api_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_cluster_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_cluster_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_disk_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_disk_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_event_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py validate-modules:undocumented-parameter
-plugins/modules/cloud/ovirt/ovirt_group_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_group_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_host_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_host_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_network_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_network_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_nic_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_nic_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_permission_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_permission_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_quota_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_quota_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_tag_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_tag_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_template_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_template_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_user_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_user_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/rackspace/rax.py use-argspec-type-path # fix needed
plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-invalid-choice
plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path
plugins/modules/cloud/rackspace/rax_mon_notification_plan.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values
-plugins/modules/cloud/scaleway/scaleway_image_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_image_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_ip_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_ip_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_organization_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_security_group_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_security_group_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_server_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_server_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_snapshot_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_volume_info.py validate-modules:return-syntax-error
plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter
@@ -101,8 +42,6 @@ plugins/modules/cloud/xenserver/xenserver_guest.py validate-modules:undocumented
plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type
plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter
plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice
-plugins/modules/net_tools/ldap/ldap_attr.py validate-modules:parameter-type-not-in-doc # This triggers when a parameter is undocumented
-plugins/modules/net_tools/ldap/ldap_attr.py validate-modules:undocumented-parameter # Parameter removed but reason for removal is shown by custom code
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:doc-missing-type
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:parameter-type-not-in-doc
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:undocumented-parameter # Parameter removed but reason for removal is shown by custom code
@@ -130,16 +69,6 @@ plugins/modules/remote_management/stacki/stacki_host.py validate-modules:doc-def
plugins/modules/remote_management/stacki/stacki_host.py validate-modules:parameter-type-not-in-doc
plugins/modules/remote_management/stacki/stacki_host.py validate-modules:undocumented-parameter
plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid
-plugins/modules/storage/glusterfs/gluster_heal_info.py validate-modules:parameter-type-not-in-doc
-plugins/modules/storage/glusterfs/gluster_peer.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:parameter-type-not-in-doc
-plugins/modules/storage/netapp/na_ontap_gather_facts.py validate-modules:parameter-state-invalid-choice
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:doc-required-mismatch
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:return-syntax-error
-plugins/modules/storage/purestorage/purefb_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/purestorage/purefb_facts.py validate-modules:return-syntax-error
plugins/modules/system/gconftool2.py validate-modules:parameter-state-invalid-choice
plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter
plugins/modules/system/launchd.py use-argspec-type-path # False positive
diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt
index 547a788be0..51fe901ba5 100644
--- a/tests/sanity/ignore-2.11.txt
+++ b/tests/sanity/ignore-2.11.txt
@@ -8,78 +8,19 @@ plugins/modules/cloud/linode/linode.py validate-modules:undocumented-parameter
plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path
plugins/modules/cloud/lxc/lxc_container.py validate-modules:use-run-command-not-popen
plugins/modules/cloud/misc/rhevm.py validate-modules:parameter-state-invalid-choice
-plugins/modules/cloud/online/online_server_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/online/online_server_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/online/online_user_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/online/online_user_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_api_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_cluster_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_cluster_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_disk_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_disk_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_event_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py validate-modules:undocumented-parameter
-plugins/modules/cloud/ovirt/ovirt_group_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_group_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_host_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_host_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_network_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_network_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_nic_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_nic_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_permission_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_permission_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_quota_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_quota_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_tag_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_tag_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_template_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_template_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_user_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_user_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/rackspace/rax.py use-argspec-type-path # fix needed
plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-invalid-choice
plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path
plugins/modules/cloud/rackspace/rax_mon_notification_plan.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values
-plugins/modules/cloud/scaleway/scaleway_image_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_image_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_ip_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_ip_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_organization_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_security_group_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_security_group_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_server_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_server_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_snapshot_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_volume_info.py validate-modules:return-syntax-error
plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter
@@ -100,8 +41,6 @@ plugins/modules/cloud/xenserver/xenserver_guest.py validate-modules:undocumented
plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type
plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter
plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice
-plugins/modules/net_tools/ldap/ldap_attr.py validate-modules:parameter-type-not-in-doc # This triggers when a parameter is undocumented
-plugins/modules/net_tools/ldap/ldap_attr.py validate-modules:undocumented-parameter # Parameter removed but reason for removal is shown by custom code
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:doc-missing-type
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:parameter-type-not-in-doc
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:undocumented-parameter # Parameter removed but reason for removal is shown by custom code
@@ -129,16 +68,6 @@ plugins/modules/remote_management/stacki/stacki_host.py validate-modules:doc-def
plugins/modules/remote_management/stacki/stacki_host.py validate-modules:parameter-type-not-in-doc
plugins/modules/remote_management/stacki/stacki_host.py validate-modules:undocumented-parameter
plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid
-plugins/modules/storage/glusterfs/gluster_heal_info.py validate-modules:parameter-type-not-in-doc
-plugins/modules/storage/glusterfs/gluster_peer.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:parameter-type-not-in-doc
-plugins/modules/storage/netapp/na_ontap_gather_facts.py validate-modules:parameter-state-invalid-choice
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:doc-required-mismatch
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:return-syntax-error
-plugins/modules/storage/purestorage/purefb_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/purestorage/purefb_facts.py validate-modules:return-syntax-error
plugins/modules/system/gconftool2.py validate-modules:parameter-state-invalid-choice
plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter
plugins/modules/system/launchd.py use-argspec-type-path # False positive
diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt
index 547a788be0..51fe901ba5 100644
--- a/tests/sanity/ignore-2.12.txt
+++ b/tests/sanity/ignore-2.12.txt
@@ -8,78 +8,19 @@ plugins/modules/cloud/linode/linode.py validate-modules:undocumented-parameter
plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path
plugins/modules/cloud/lxc/lxc_container.py validate-modules:use-run-command-not-popen
plugins/modules/cloud/misc/rhevm.py validate-modules:parameter-state-invalid-choice
-plugins/modules/cloud/online/online_server_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/online/online_server_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/online/online_user_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/online/online_user_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_api_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_cluster_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_cluster_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_disk_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_disk_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_event_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py validate-modules:undocumented-parameter
-plugins/modules/cloud/ovirt/ovirt_group_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_group_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_host_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_host_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_network_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_network_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_nic_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_nic_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_permission_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_permission_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_quota_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_quota_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_tag_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_tag_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_template_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_template_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_user_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_user_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/rackspace/rax.py use-argspec-type-path # fix needed
plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-invalid-choice
plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path
plugins/modules/cloud/rackspace/rax_mon_notification_plan.py validate-modules:parameter-list-no-elements
plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values
-plugins/modules/cloud/scaleway/scaleway_image_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_image_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_ip_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_ip_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_organization_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_security_group_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_security_group_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_server_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_server_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_snapshot_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_volume_info.py validate-modules:return-syntax-error
plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter
@@ -100,8 +41,6 @@ plugins/modules/cloud/xenserver/xenserver_guest.py validate-modules:undocumented
plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type
plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter
plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice
-plugins/modules/net_tools/ldap/ldap_attr.py validate-modules:parameter-type-not-in-doc # This triggers when a parameter is undocumented
-plugins/modules/net_tools/ldap/ldap_attr.py validate-modules:undocumented-parameter # Parameter removed but reason for removal is shown by custom code
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:doc-missing-type
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:parameter-type-not-in-doc
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:undocumented-parameter # Parameter removed but reason for removal is shown by custom code
@@ -129,16 +68,6 @@ plugins/modules/remote_management/stacki/stacki_host.py validate-modules:doc-def
plugins/modules/remote_management/stacki/stacki_host.py validate-modules:parameter-type-not-in-doc
plugins/modules/remote_management/stacki/stacki_host.py validate-modules:undocumented-parameter
plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid
-plugins/modules/storage/glusterfs/gluster_heal_info.py validate-modules:parameter-type-not-in-doc
-plugins/modules/storage/glusterfs/gluster_peer.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:parameter-type-not-in-doc
-plugins/modules/storage/netapp/na_ontap_gather_facts.py validate-modules:parameter-state-invalid-choice
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:doc-required-mismatch
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:return-syntax-error
-plugins/modules/storage/purestorage/purefb_facts.py validate-modules:parameter-list-no-elements
-plugins/modules/storage/purestorage/purefb_facts.py validate-modules:return-syntax-error
plugins/modules/system/gconftool2.py validate-modules:parameter-state-invalid-choice
plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter
plugins/modules/system/launchd.py use-argspec-type-path # False positive
diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt
index f5bbfa704d..c10f7be552 100644
--- a/tests/sanity/ignore-2.9.txt
+++ b/tests/sanity/ignore-2.9.txt
@@ -7,122 +7,17 @@ plugins/modules/cloud/linode/linode.py validate-modules:parameter-type-not-in-do
plugins/modules/cloud/linode/linode.py validate-modules:undocumented-parameter
plugins/modules/cloud/lxc/lxc_container.py use-argspec-type-path
plugins/modules/cloud/lxc/lxc_container.py validate-modules:use-run-command-not-popen
-plugins/modules/cloud/misc/helm.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/misc/helm.py validate-modules:invalid-documentation
-plugins/modules/cloud/misc/ovirt.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/misc/ovirt.py validate-modules:invalid-documentation
-plugins/modules/cloud/online/online_server_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/online/online_server_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/online/online_server_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/online/online_server_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/online/online_user_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/online/online_user_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/online/online_user_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/online/online_user_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_affinity_label_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_api_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_api_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_cluster_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_cluster_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_cluster_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_datacenter_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_disk_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_disk_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_disk_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_event_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_event_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_external_provider_facts.py validate-modules:undocumented-parameter
-plugins/modules/cloud/ovirt/ovirt_group_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_group_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_group_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_host_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_host_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_host_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_host_storage_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_network_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_network_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_network_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_nic_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_nic_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_nic_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_permission_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_permission_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_permission_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_quota_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_quota_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_quota_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_snapshot_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_domain_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_storage_template_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_storage_vm_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_tag_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_tag_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_tag_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_template_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_template_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_template_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_user_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_user_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_user_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/ovirt/ovirt_vm_facts.py validate-modules:parameter-type-not-in-doc
-plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:doc-missing-type
-plugins/modules/cloud/ovirt/ovirt_vmpool_facts.py validate-modules:invalid-documentation
plugins/modules/cloud/rackspace/rax.py use-argspec-type-path
plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path
plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values
-plugins/modules/cloud/scaleway/scaleway_image_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/scaleway/scaleway_image_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/scaleway/scaleway_image_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_image_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_ip_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/scaleway/scaleway_ip_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/scaleway/scaleway_ip_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_ip_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_organization_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/scaleway/scaleway_organization_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/scaleway/scaleway_organization_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_security_group_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/scaleway/scaleway_security_group_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/scaleway/scaleway_security_group_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_security_group_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_server_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/scaleway/scaleway_server_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/scaleway/scaleway_server_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_server_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/scaleway/scaleway_snapshot_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_snapshot_info.py validate-modules:return-syntax-error
-plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:deprecation-mismatch
-plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:invalid-documentation
-plugins/modules/cloud/scaleway/scaleway_volume_facts.py validate-modules:return-syntax-error
plugins/modules/cloud/scaleway/scaleway_volume_info.py validate-modules:return-syntax-error
plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc
plugins/modules/cloud/smartos/vmadm.py validate-modules:undocumented-parameter
@@ -137,10 +32,6 @@ plugins/modules/cloud/xenserver/xenserver_guest.py validate-modules:parameter-ty
plugins/modules/cloud/xenserver/xenserver_guest.py validate-modules:undocumented-parameter
plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type
plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter
-plugins/modules/net_tools/ldap/ldap_attr.py validate-modules:deprecation-mismatch
-plugins/modules/net_tools/ldap/ldap_attr.py validate-modules:invalid-documentation
-plugins/modules/net_tools/ldap/ldap_attr.py validate-modules:parameter-type-not-in-doc
-plugins/modules/net_tools/ldap/ldap_attr.py validate-modules:undocumented-parameter # Parameter removed but reason for removal is shown by custom code
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:doc-missing-type
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:parameter-type-not-in-doc
plugins/modules/net_tools/ldap/ldap_entry.py validate-modules:undocumented-parameter # Parameter removed but reason for removal is shown by custom code
@@ -165,22 +56,6 @@ plugins/modules/remote_management/stacki/stacki_host.py validate-modules:doc-def
plugins/modules/remote_management/stacki/stacki_host.py validate-modules:parameter-type-not-in-doc
plugins/modules/remote_management/stacki/stacki_host.py validate-modules:undocumented-parameter
plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid
-plugins/modules/storage/glusterfs/gluster_heal_info.py validate-modules:deprecation-mismatch
-plugins/modules/storage/glusterfs/gluster_heal_info.py validate-modules:invalid-documentation
-plugins/modules/storage/glusterfs/gluster_heal_info.py validate-modules:parameter-type-not-in-doc
-plugins/modules/storage/glusterfs/gluster_peer.py validate-modules:deprecation-mismatch
-plugins/modules/storage/glusterfs/gluster_peer.py validate-modules:invalid-documentation
-plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:deprecation-mismatch
-plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:invalid-documentation
-plugins/modules/storage/glusterfs/gluster_volume.py validate-modules:parameter-type-not-in-doc
-plugins/modules/storage/netapp/na_ontap_gather_facts.py validate-modules:deprecation-mismatch
-plugins/modules/storage/netapp/na_ontap_gather_facts.py validate-modules:invalid-documentation
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:deprecation-mismatch
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:invalid-documentation
-plugins/modules/storage/purestorage/purefa_facts.py validate-modules:return-syntax-error
-plugins/modules/storage/purestorage/purefb_facts.py validate-modules:deprecation-mismatch
-plugins/modules/storage/purestorage/purefb_facts.py validate-modules:invalid-documentation
-plugins/modules/storage/purestorage/purefb_facts.py validate-modules:return-syntax-error
plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter
plugins/modules/system/launchd.py use-argspec-type-path # False positive
plugins/modules/system/puppet.py use-argspec-type-path
@@ -189,8 +64,6 @@ plugins/modules/system/runit.py validate-modules:parameter-type-not-in-doc
plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path
plugins/modules/system/xfconf.py validate-modules:return-syntax-error
plugins/modules/web_infrastructure/jenkins_plugin.py use-argspec-type-path
-plugins/modules/web_infrastructure/nginx_status_facts.py validate-modules:deprecation-mismatch
-plugins/modules/web_infrastructure/nginx_status_facts.py validate-modules:invalid-documentation
tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.6 # django generated code
tests/integration/targets/django_manage/files/base_test/simple_project/p1/manage.py compile-2.7 # django generated code
tests/utils/shippable/check_matrix.py replace-urlopen