diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_host_networks.py b/lib/ansible/modules/cloud/ovirt/_ovirt_host_networks.py new file mode 120000 index 0000000000..03356e5267 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_host_networks.py @@ -0,0 +1 @@ +ovirt_host_network.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_hosts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_hosts.py new file mode 120000 index 0000000000..388dd78536 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_hosts.py @@ -0,0 +1 @@ +ovirt_host.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_hosts_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_hosts_facts.py new file mode 120000 index 0000000000..243e94c2f0 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_hosts_facts.py @@ -0,0 +1 @@ +ovirt_host_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_mac_pools.py b/lib/ansible/modules/cloud/ovirt/_ovirt_mac_pools.py new file mode 120000 index 0000000000..e518729a5e --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_mac_pools.py @@ -0,0 +1 @@ +ovirt_mac_pool.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_networks.py b/lib/ansible/modules/cloud/ovirt/_ovirt_networks.py new file mode 120000 index 0000000000..93006fd6ed --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_networks.py @@ -0,0 +1 @@ +ovirt_network.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_networks_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_networks_facts.py new file mode 120000 index 0000000000..11c253f8ca --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_networks_facts.py @@ -0,0 +1 @@ +ovirt_network_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_nics.py b/lib/ansible/modules/cloud/ovirt/_ovirt_nics.py new file mode 120000 index 0000000000..f5f35c34e0 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_nics.py @@ -0,0 +1 @@ +ovirt_nic.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_nics_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_nics_facts.py new file mode 120000 index 0000000000..b3c27b4b9e --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_nics_facts.py @@ -0,0 +1 @@ +ovirt_nic_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_permissions.py b/lib/ansible/modules/cloud/ovirt/_ovirt_permissions.py new file mode 120000 index 0000000000..013e35713f --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_permissions.py @@ -0,0 +1 @@ +ovirt_permission.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_permissions_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_permissions_facts.py new file mode 120000 index 0000000000..32b00ac5f2 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_permissions_facts.py @@ -0,0 +1 @@ +ovirt_permission_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_quotas.py b/lib/ansible/modules/cloud/ovirt/_ovirt_quotas.py new file mode 120000 index 0000000000..de2c22ab09 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_quotas.py @@ -0,0 +1 @@ +ovirt_quota.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_quotas_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_quotas_facts.py new file mode 120000 index 0000000000..099905ea3b --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_quotas_facts.py @@ -0,0 +1 @@ +ovirt_quota_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_scheduling_policies_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_scheduling_policies_facts.py new file mode 120000 index 0000000000..caf461d5a3 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_scheduling_policies_facts.py @@ -0,0 +1 @@ +ovirt_scheduling_policy_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_snapshots.py b/lib/ansible/modules/cloud/ovirt/_ovirt_snapshots.py new file mode 120000 index 0000000000..fd53874c17 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_snapshots.py @@ -0,0 +1 @@ +ovirt_snapshot.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_snapshots_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_snapshots_facts.py new file mode 120000 index 0000000000..0116e96b1a --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_snapshots_facts.py @@ -0,0 +1 @@ +ovirt_snapshot_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_storage_connections.py b/lib/ansible/modules/cloud/ovirt/_ovirt_storage_connections.py new file mode 120000 index 0000000000..c42994b3ee --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_storage_connections.py @@ -0,0 +1 @@ +ovirt_storage_connection.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_storage_domains.py b/lib/ansible/modules/cloud/ovirt/_ovirt_storage_domains.py new file mode 120000 index 0000000000..0d5bd80ea3 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_storage_domains.py @@ -0,0 +1 @@ +ovirt_storage_domain.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_storage_domains_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_storage_domains_facts.py new file mode 120000 index 0000000000..e3102b1939 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_storage_domains_facts.py @@ -0,0 +1 @@ +ovirt_storage_domain_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_storage_templates_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_storage_templates_facts.py new file mode 120000 index 0000000000..aca2a6f8a5 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_storage_templates_facts.py @@ -0,0 +1 @@ +ovirt_storage_template_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_storage_vms_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_storage_vms_facts.py new file mode 120000 index 0000000000..44c6e72b38 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_storage_vms_facts.py @@ -0,0 +1 @@ +ovirt_storage_vm_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_tags.py b/lib/ansible/modules/cloud/ovirt/_ovirt_tags.py new file mode 120000 index 0000000000..361e12fd5b --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_tags.py @@ -0,0 +1 @@ +ovirt_tag.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_tags_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_tags_facts.py new file mode 120000 index 0000000000..29de4f63d1 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_tags_facts.py @@ -0,0 +1 @@ +ovirt_tag_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_templates.py b/lib/ansible/modules/cloud/ovirt/_ovirt_templates.py new file mode 120000 index 0000000000..a987e7f47c --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_templates.py @@ -0,0 +1 @@ +ovirt_template.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_templates_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_templates_facts.py new file mode 120000 index 0000000000..2045d76ab8 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_templates_facts.py @@ -0,0 +1 @@ +ovirt_template_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_users.py b/lib/ansible/modules/cloud/ovirt/_ovirt_users.py new file mode 120000 index 0000000000..f32d164ef4 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_users.py @@ -0,0 +1 @@ +ovirt_user.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_users_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_users_facts.py new file mode 120000 index 0000000000..2675ae6432 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_users_facts.py @@ -0,0 +1 @@ +ovirt_user_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_vmpools.py b/lib/ansible/modules/cloud/ovirt/_ovirt_vmpools.py new file mode 120000 index 0000000000..0afacc5b96 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_vmpools.py @@ -0,0 +1 @@ +ovirt_vmpool.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_vmpools_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_vmpools_facts.py new file mode 120000 index 0000000000..78d066bb91 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_vmpools_facts.py @@ -0,0 +1 @@ +ovirt_vmpool_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_vms.py b/lib/ansible/modules/cloud/ovirt/_ovirt_vms.py new file mode 120000 index 0000000000..d2d70257f4 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_vms.py @@ -0,0 +1 @@ +ovirt_vm.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/_ovirt_vms_facts.py b/lib/ansible/modules/cloud/ovirt/_ovirt_vms_facts.py new file mode 120000 index 0000000000..e1a5f4b639 --- /dev/null +++ b/lib/ansible/modules/cloud/ovirt/_ovirt_vms_facts.py @@ -0,0 +1 @@ +ovirt_vm_facts.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_hosts.py b/lib/ansible/modules/cloud/ovirt/ovirt_host.py similarity index 96% rename from lib/ansible/modules/cloud/ovirt/ovirt_hosts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_host.py index bbc6beb2dc..0376dd19a2 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_hosts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_host.py @@ -11,7 +11,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_hosts +module: ovirt_host short_description: Module to manage hosts in oVirt/RHV version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -34,6 +34,11 @@ options: comment: description: - "Description of the host." + timeout: + description: + - "The amount of time in seconds the module should wait for the host to + get into desired state." + default: 600 cluster: description: - "Name of the cluster, where host should be created." @@ -48,12 +53,12 @@ options: - "I(True) if the public key should be used to authenticate to host." - "It's required in case C(password) is not set." default: False + type: bool aliases: ['ssh_public_key'] kdump_integration: description: - "Specify if host will have enabled Kdump integration." choices: ['enabled', 'disabled'] - default: enabled spm_priority: description: - "SPM priority of the host. Integer value from 1 to 10, where higher number means higher priority." @@ -61,13 +66,16 @@ options: description: - "If True host iptables will be overridden by host deploy script." - "Note that C(override_iptables) is I(false) by default in oVirt/RHV." + type: bool force: description: - "If True host will be forcibly moved to desired state." default: False + type: bool override_display: description: - "Override the display address of all VMs on this host with specified address." + type: bool kernel_params: description: - "List of kernel boot parameters." @@ -89,17 +97,22 @@ options: - "If I(undeploy) it means this host should un-deploy hosted engine components and this host will not function as part of the High Availability cluster." + choices: + - 'deploy' + - 'undeploy' power_management_enabled: description: - "Enable or disable power management of the host." - "For more comprehensive setup of PM use C(ovirt_host_pm) module." version_added: 2.4 + type: bool activate: description: - "If C(state) is I(present) activate the host." - "This parameter is good to disable, when you don't want to change the state of host when using I(present) C(state)." default: True + type: bool version_added: 2.4 iscsi: description: @@ -113,11 +126,13 @@ options: - "If I(true) and C(state) is I(upgraded) run check for upgrade action before executing upgrade action." default: True + type: bool version_added: 2.4 reboot_after_upgrade: description: - "If I(true) and C(state) is I(upgraded) reboot host after successful upgrade." default: True + type: bool version_added: 2.6 extends_documentation_fragment: ovirt ''' @@ -128,7 +143,7 @@ EXAMPLES = ''' # Add host with username/password supporting SR-IOV. # Note that override_iptables is false by default in oVirt/RHV: -- ovirt_hosts: +- ovirt_host: cluster: Default name: myhost address: 10.34.61.145 @@ -138,7 +153,7 @@ EXAMPLES = ''' - intel_iommu=on # Add host using public key -- ovirt_hosts: +- ovirt_host: public_key: true cluster: Default name: myhost2 @@ -146,7 +161,7 @@ EXAMPLES = ''' override_iptables: true # Deploy hosted engine host -- ovirt_hosts: +- ovirt_host: cluster: Default name: myhost2 password: secret @@ -155,22 +170,22 @@ EXAMPLES = ''' hosted_engine: deploy # Maintenance -- ovirt_hosts: +- ovirt_host: state: maintenance name: myhost # Restart host using power management: -- ovirt_hosts: +- ovirt_host: state: restarted name: myhost # Upgrade host -- ovirt_hosts: +- ovirt_host: state: upgraded name: myhost # discover iscsi targets -- ovirt_hosts: +- ovirt_host: state: iscsidiscover name: myhost iscsi: @@ -181,7 +196,7 @@ EXAMPLES = ''' # login to iscsi targets -- ovirt_hosts: +- ovirt_host: state: iscsilogin name: myhost iscsi: @@ -193,13 +208,13 @@ EXAMPLES = ''' # Reinstall host using public key -- ovirt_hosts: +- ovirt_host: state: reinstalled name: myhost public_key: true # Remove host -- ovirt_hosts: +- ovirt_host: state: absent name: myhost force: True @@ -412,6 +427,10 @@ def main(): ['state', 'iscsilogin', ['iscsi']] ] ) + + if module._name == 'ovirt_hosts': + module.deprecate("The 'ovirt_hosts' module is being renamed 'ovirt_host'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_hosts_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_host_facts.py similarity index 93% rename from lib/ansible/modules/cloud/ovirt/ovirt_hosts_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_host_facts.py index 83a7489a1d..5e6b677664 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_hosts_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_host_facts.py @@ -11,7 +11,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_hosts_facts +module: ovirt_host_facts short_description: Retrieve facts about one or more oVirt/RHV hosts author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -32,6 +32,7 @@ options: included in the response." default: False version_added: "2.7" + type: bool extends_documentation_fragment: ovirt_facts ''' @@ -41,7 +42,7 @@ EXAMPLES = ''' # Gather facts about all hosts which names start with C(host) and # belong to data center C(west): -- ovirt_hosts_facts: +- ovirt_host_facts: pattern: name=host* and datacenter=west - debug: var: ovirt_hosts @@ -72,6 +73,10 @@ def main(): all_content=dict(default=False, type='bool'), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_hosts_facts': + module.deprecate("The 'ovirt_hosts_facts' module is being renamed 'ovirt_host_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py b/lib/ansible/modules/cloud/ovirt/ovirt_host_network.py similarity index 97% rename from lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py rename to lib/ansible/modules/cloud/ovirt/ovirt_host_network.py index 1b4c39f5a7..243b6134d4 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_host_network.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_host_networks +module: ovirt_host_network short_description: Module to manage host networks in oVirt/RHV version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -37,6 +37,8 @@ options: description: - "Name of the host to manage networks for." required: true + aliases: + - 'host' state: description: - "Should the host be present/absent." @@ -69,9 +71,11 @@ options: - "If I(true) verify connectivity between host and engine." - "Network configuration changes will be rolled back if connectivity between engine and the host is lost after changing network configuration." + type: bool save: description: - "If I(true) network configuration will be persistent, by default they are temporary." + type: bool extends_documentation_fragment: ovirt ''' @@ -81,7 +85,7 @@ EXAMPLES = ''' # Create bond on eth0 and eth1 interface, and put 'myvlan' network on top of it: - name: Bonds - ovirt_host_networks: + ovirt_host_network: name: myhost bond: name: bond0 @@ -99,7 +103,7 @@ EXAMPLES = ''' # Create bond on eth1 and eth2 interface, specifiyng both mode and miimon: - name: Bonds - ovirt_host_networks: + ovirt_host_network: name: myhost bond: name: bond0 @@ -111,14 +115,14 @@ EXAMPLES = ''' - eth2 # Remove bond0 bond from host interfaces: -- ovirt_host_networks: +- ovirt_host_network: state: absent name: myhost bond: name: bond0 # Assign myvlan1 and myvlan2 vlans to host eth0 interface: -- ovirt_host_networks: +- ovirt_host_network: name: myhost interface: eth0 networks: @@ -126,7 +130,7 @@ EXAMPLES = ''' - name: myvlan2 # Remove myvlan2 vlan from host eth0 interface: -- ovirt_host_networks: +- ovirt_host_network: state: absent name: myhost interface: eth0 @@ -134,7 +138,7 @@ EXAMPLES = ''' - name: myvlan2 # Remove all networks/vlans from host eth0 interface: -- ovirt_host_networks: +- ovirt_host_network: state: absent name: myhost interface: eth0 @@ -320,7 +324,7 @@ def main(): choices=['present', 'absent'], default='present', ), - name=dict(default=None, aliases=['host'], required=True), + name=dict(aliases=['host'], required=True), bond=dict(default=None, type='dict'), interface=dict(default=None), networks=dict(default=None, type='list'), @@ -329,6 +333,10 @@ def main(): save=dict(default=None, type='bool'), ) module = AnsibleModule(argument_spec=argument_spec) + + if module._name == 'ovirt_host_networks': + module.deprecate("The 'ovirt_host_networks' module is being renamed 'ovirt_host_network'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_mac_pools.py b/lib/ansible/modules/cloud/ovirt/ovirt_mac_pool.py similarity index 94% rename from lib/ansible/modules/cloud/ovirt/ovirt_mac_pools.py rename to lib/ansible/modules/cloud/ovirt/ovirt_mac_pool.py index f43e23743e..22858f3b73 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_mac_pools.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_mac_pool.py @@ -11,7 +11,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_mac_pools +module: ovirt_mac_pool short_description: Module to manage MAC pools in oVirt/RHV version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -34,6 +34,7 @@ options: description: - "If I(true) allow a MAC address to be used multiple times in a pool." - "Default value is set by oVirt/RHV engine to I(false)." + type: bool ranges: description: - "List of MAC ranges. The from and to should be split by comma." @@ -46,7 +47,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Create MAC pool: -- ovirt_mac_pools: +- ovirt_mac_pool: name: mymacpool allow_duplicates: false ranges: @@ -54,7 +55,7 @@ EXAMPLES = ''' - 00:1a:4a:16:02:51,00:1a:4a:16:02:61 # Remove MAC pool: -- ovirt_mac_pools: +- ovirt_mac_pool: state: absent name: mymacpool ''' @@ -129,7 +130,7 @@ def main(): choices=['present', 'absent'], default='present', ), - name=dict(default=None, required=True), + name=dict(required=True), allow_duplicates=dict(default=None, type='bool'), description=dict(default=None), ranges=dict(default=None, type='list'), @@ -138,6 +139,10 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) + + if module._name == 'ovirt_mac_pools': + module.deprecate("The 'ovirt_mac_pools' module is being renamed 'ovirt_mac_pool'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_networks.py b/lib/ansible/modules/cloud/ovirt/ovirt_network.py similarity index 97% rename from lib/ansible/modules/cloud/ovirt/ovirt_networks.py rename to lib/ansible/modules/cloud/ovirt/ovirt_network.py index 63a08cd5eb..a7e6a9d475 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_networks.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_network.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_networks +module: ovirt_network short_description: Module to manage logical networks in oVirt/RHV version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -58,6 +58,7 @@ options: description: - "If I(True) network will be marked as network for VM." - "VM network carries traffic relevant to the virtual machine." + type: bool mtu: description: - "Maximum transmission unit (MTU) of the network." @@ -82,14 +83,14 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Create network -- ovirt_networks: +- ovirt_network: data_center: mydatacenter name: mynetwork vlan_tag: 1 vm_network: true # Remove network -- ovirt_networks: +- ovirt_network: state: absent name: mynetwork ''' @@ -224,8 +225,8 @@ def main(): choices=['present', 'absent'], default='present', ), - data_center=dict(default=None, required=True), - name=dict(default=None, required=True), + data_center=dict(required=True), + name=dict(required=True), description=dict(default=None), comment=dict(default=None), vlan_tag=dict(default=None, type='int'), @@ -238,6 +239,10 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) + + if module._name == 'ovirt_networks': + module.deprecate("The 'ovirt_networks' module is being renamed 'ovirt_network'", version=2.8) + check_sdk(module) check_params(module) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_networks_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_network_facts.py similarity index 94% rename from lib/ansible/modules/cloud/ovirt/ovirt_networks_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_network_facts.py index 5adf6b1f9d..4aa879f620 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_networks_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_network_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_networks_facts +module: ovirt_network_facts short_description: Retrieve facts about one or more oVirt/RHV networks author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -49,7 +49,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Gather facts about all networks which names start with C(vlan1): -- ovirt_networks_facts: +- ovirt_network_facts: pattern: name=vlan1* - debug: var: ovirt_networks @@ -80,6 +80,10 @@ def main(): pattern=dict(default='', required=False), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_networks_facts': + module.deprecate("The 'ovirt_networks_facts' module is being renamed 'ovirt_network_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_nics.py b/lib/ansible/modules/cloud/ovirt/ovirt_nic.py similarity index 96% rename from lib/ansible/modules/cloud/ovirt/ovirt_nics.py rename to lib/ansible/modules/cloud/ovirt/ovirt_nic.py index d2cd0143c9..20a6ccf221 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_nics.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_nic.py @@ -10,7 +10,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_nics +module: ovirt_nic short_description: Module to manage network interfaces of Virtual Machines in oVirt/RHV version_added: "2.3" author: @@ -45,9 +45,8 @@ options: - Virtual network interface profile to be attached to VM network interface. interface: description: - - "Type of the network interface." + - "Type of the network interface. For example e1000, pci_passthrough, rtl8139, rtl8139_virtio, spapr_vlan or virtio." - "It's required parameter when creating the new NIC." - choices: [ e1000, pci_passthrough, rtl8139, rtl8139_virtio, spapr_vlan, virtio ] mac_address: description: - Custom MAC address of the network interface, by default it's obtained from MAC pool. @@ -59,7 +58,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: - name: Add NIC to VM - ovirt_nics: + ovirt_nic: state: present vm: myvm name: mynic @@ -69,19 +68,19 @@ EXAMPLES = ''' network: ovirtmgmt - name: Plug NIC to VM - ovirt_nics: + ovirt_nic: state: plugged vm: myvm name: mynic - name: Unplug NIC from VM - ovirt_nics: + ovirt_nic: state: unplugged vm: myvm name: mynic - name: Add NIC to template - ovirt_nics: + ovirt_nic: auth: "{{ ovirt_auth }}" state: present template: my_template @@ -91,7 +90,7 @@ EXAMPLES = ''' network: ovirtmgmt - name: Remove NIC from VM - ovirt_nics: + ovirt_nic: state: absent vm: myvm name: mynic @@ -187,6 +186,10 @@ def main(): supports_check_mode=True, required_one_of=[['vm', 'template']], ) + + if module._name == 'ovirt_nics': + module.deprecate("The 'ovirt_nics' module is being renamed 'ovirt_nic'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_nics_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_nic_facts.py similarity index 95% rename from lib/ansible/modules/cloud/ovirt/ovirt_nics_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_nic_facts.py index 11c56f188a..5cf96c953c 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_nics_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_nic_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_nics_facts +module: ovirt_nic_facts short_description: Retrieve facts about one or more oVirt/RHV virtual machine network interfaces author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -51,7 +51,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Gather facts about all NICs which names start with C(eth) for VM named C(centos7): -- ovirt_nics_facts: +- ovirt_nic_facts: vm: centos7 name: eth* - debug: @@ -85,6 +85,10 @@ def main(): name=dict(default=None), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_nics_facts': + module.deprecate("The 'ovirt_nics_facts' module is being renamed 'ovirt_nic_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_permissions.py b/lib/ansible/modules/cloud/ovirt/ovirt_permission.py similarity index 97% rename from lib/ansible/modules/cloud/ovirt/ovirt_permissions.py rename to lib/ansible/modules/cloud/ovirt/ovirt_permission.py index 7eebb3eebd..a076d20c86 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_permissions.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_permission.py @@ -10,7 +10,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_permissions +module: ovirt_permission short_description: Module to manage permissions of users/groups in oVirt/RHV version_added: "2.3" author: @@ -78,7 +78,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: - name: Add user user1 from authorization provider example.com-authz - ovirt_permissions: + ovirt_permission: user_name: user1 authz_name: example.com-authz object_type: vm @@ -86,7 +86,7 @@ EXAMPLES = ''' role: UserVmManager - name: Remove permission from user - ovirt_permissions: + ovirt_permission: state: absent user_name: user1 authz_name: example.com-authz @@ -253,6 +253,10 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) + + if module._name == 'ovirt_permissions': + module.deprecate("The 'ovirt_permissions' module is being renamed 'ovirt_permission'", version=2.8) + check_sdk(module) if (module.params['object_name'] is None and module.params['object_id'] is None) and module.params['object_type'] != 'system': diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_permissions_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_permission_facts.py similarity index 95% rename from lib/ansible/modules/cloud/ovirt/ovirt_permissions_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_permission_facts.py index e2a783ac92..a5389bd5bb 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_permissions_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_permission_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_permissions_facts +module: ovirt_permission_facts short_description: Retrieve facts about one or more oVirt/RHV permissions author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -59,7 +59,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Gather facts about all permissions of user with username C(john): -- ovirt_permissions_facts: +- ovirt_permission_facts: user_name: john authz_name: example.com-authz - debug: @@ -122,6 +122,10 @@ def main(): namespace=dict(default=None), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_permissions_facts': + module.deprecate("The 'ovirt_permissions_facts' module is being renamed 'ovirt_permission_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_quotas.py b/lib/ansible/modules/cloud/ovirt/ovirt_quota.py similarity index 95% rename from lib/ansible/modules/cloud/ovirt/ovirt_quotas.py rename to lib/ansible/modules/cloud/ovirt/ovirt_quota.py index 57cd072aa2..3926534e18 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_quotas.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_quota.py @@ -11,7 +11,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_quotas +module: ovirt_quota short_description: Module to manage datacenter quotas in oVirt/RHV version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -37,15 +37,23 @@ options: cluster_threshold: description: - "Cluster threshold(soft limit) defined in percentage (0-100)." + aliases: + - "cluster_soft_limit" cluster_grace: description: - "Cluster grace(hard limit) defined in percentage (1-100)." + aliases: + - "cluster_hard_limit" storage_threshold: description: - "Storage threshold(soft limit) defined in percentage (0-100)." + aliases: + - "storage_soft_limit" storage_grace: description: - "Storage grace(hard limit) defined in percentage (1-100)." + aliases: + - "storage_hard_limit" clusters: description: - "List of dictionary of cluster limits, which is valid to specific cluster." @@ -67,7 +75,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Add cluster quota to cluster cluster1 with memory limit 20GiB and CPU limit to 10: -- ovirt_quotas: +- ovirt_quota: name: quota1 data_center: dcX clusters: @@ -76,7 +84,7 @@ EXAMPLES = ''' cpu: 10 # Add cluster quota to all clusters with memory limit 30GiB and CPU limit to 15: -- ovirt_quotas: +- ovirt_quota: name: quota2 data_center: dcX clusters: @@ -84,7 +92,7 @@ EXAMPLES = ''' cpu: 15 # Add storage quota to storage data1 with size limit to 100GiB -- ovirt_quotas: +- ovirt_quota: name: quota3 data_center: dcX storage_grace: 40 @@ -94,7 +102,7 @@ EXAMPLES = ''' size: 100 # Remove quota quota1 (Note the quota must not be assigned to any VM/disk): -- ovirt_quotas: +- ovirt_quota: state: absent data_center: dcX name: quota1 @@ -222,6 +230,10 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) + + if module._name == 'ovirt_quotas': + module.deprecate("The 'ovirt_quotas' module is being renamed 'ovirt_quota'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_quotas_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_quota_facts.py similarity index 95% rename from lib/ansible/modules/cloud/ovirt/ovirt_quotas_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_quota_facts.py index 006a61e3f0..42c4e51402 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_quotas_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_quota_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_quotas_facts +module: ovirt_quota_facts short_description: Retrieve facts about one or more oVirt/RHV quotas version_added: "2.3" author: "Red Hat" @@ -51,7 +51,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Gather facts about quota named C in Default datacenter: -- ovirt_quotas_facts: +- ovirt_quota_facts: data_center: Default name: myquota - debug: @@ -85,6 +85,10 @@ def main(): name=dict(default=None), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_quotas_facts': + module.deprecate("The 'ovirt_quotas_facts' module is being renamed 'ovirt_quota_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_scheduling_policies_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py similarity index 93% rename from lib/ansible/modules/cloud/ovirt/ovirt_scheduling_policies_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py index a64dc6507f..b2cc4bc63c 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_scheduling_policies_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_scheduling_policy_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_scheduling_policies_facts +module: ovirt_scheduling_policy_facts short_description: Retrieve facts about one or more oVirt scheduling policies author: "Ondra Machacek (@machacekondra)" version_added: "2.4" @@ -51,7 +51,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Gather facts about all scheduling policies with name InClusterUpgrade: -- ovirt_scheduling_policies_facts: +- ovirt_scheduling_policy_facts: name: InClusterUpgrade - debug: var: ovirt_scheduling_policies @@ -85,6 +85,10 @@ def main(): name=dict(default=None), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_scheduling_policie_facts': + module.deprecate("The 'ovirt_scheduling_policie_facts' module is being renamed 'ovirt_scheduling_policy_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_snapshots.py b/lib/ansible/modules/cloud/ovirt/ovirt_snapshot.py similarity index 96% rename from lib/ansible/modules/cloud/ovirt/ovirt_snapshots.py rename to lib/ansible/modules/cloud/ovirt/ovirt_snapshot.py index 26c6e08844..e988c3e820 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_snapshots.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_snapshot.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_snapshots +module: ovirt_snapshot short_description: "Module to manage Virtual Machine Snapshots in oVirt/RHV" version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -55,6 +55,10 @@ options: - "If I(true) and C(state) is I(restore) restore memory of the Virtual Machine." - "Note that Virtual Machine will be paused while saving the memory." + aliases: + - "restore_memory" + - "save_memory" + type: bool notes: - "Note that without a guest agent the data on the created snapshot may be inconsistent." @@ -71,26 +75,26 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Create snapshot: -- ovirt_snapshots: +- ovirt_snapshot: vm_name: rhel7 description: MySnapshot register: snapshot # Create snapshot and save memory: -- ovirt_snapshots: +- ovirt_snapshot: vm_name: rhel7 description: SnapWithMem use_memory: true register: snapshot # Restore snapshot: -- ovirt_snapshots: +- ovirt_snapshot: state: restore vm_name: rhel7 snapshot_id: "{{ snapshot.id }}" # Remove snapshot: -- ovirt_snapshots: +- ovirt_snapshot: state: absent vm_name: rhel7 snapshot_id: "{{ snapshot.id }}" @@ -241,6 +245,10 @@ def main(): ('state', 'restore', ['snapshot_id']), ] ) + + if module._name == 'ovirt_snapshots': + module.deprecate("The 'ovirt_snapshots' module is being renamed 'ovirt_snapshot'", version=2.8) + check_sdk(module) vm_name = module.params.get('vm_name') diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_snapshots_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_snapshot_facts.py similarity index 94% rename from lib/ansible/modules/cloud/ovirt/ovirt_snapshots_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_snapshot_facts.py index 618efa4138..8d88f95706 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_snapshots_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_snapshot_facts.py @@ -12,7 +12,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_snapshots_facts +module: ovirt_snapshot_facts short_description: Retrieve facts about one or more oVirt/RHV virtual machine snapshots author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -40,7 +40,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Gather facts about all snapshots which description start with C(update) for VM named C(centos7): -- ovirt_snapshots_facts: +- ovirt_snapshot_facts: vm: centos7 description: update* - debug: @@ -76,6 +76,10 @@ def main(): snapshot_id=dict(default=None), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_snapshots_facts': + module.deprecate("The 'ovirt_snapshots_facts' module is being renamed 'ovirt_snapshot_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_storage_connections.py b/lib/ansible/modules/cloud/ovirt/ovirt_storage_connection.py similarity index 96% rename from lib/ansible/modules/cloud/ovirt/ovirt_storage_connections.py rename to lib/ansible/modules/cloud/ovirt/ovirt_storage_connection.py index 6405c5a1b1..d3d330e661 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_storage_connections.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_storage_connection.py @@ -10,7 +10,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_storage_connections +module: ovirt_storage_connection short_description: Module to manage storage connections in oVirt version_added: "2.4" author: "Ondra Machacek (@machacekondra)" @@ -69,6 +69,7 @@ options: - "This parameter is relevant only when updating a connection." - "If I(true) the storage domain don't have to be in I(MAINTENANCE) state, so the storage connection is updated." + type: bool extends_documentation_fragment: ovirt ''' @@ -77,7 +78,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Add new storage connection: -- ovirt_storage_connections: +- ovirt_storage_connection: storage: myiscsi address: 10.34.63.199 target: iqn.2016-08-09.domain-01:nickname @@ -85,13 +86,13 @@ EXAMPLES = ''' type: iscsi # Update the existing storage connection address: -- ovirt_storage_connections: +- ovirt_storage_connection: id: 26915c96-92ff-47e5-9e77-b581db2f2d36 address: 10.34.63.204 force: true # Remove storage connection: -- ovirt_storage_connections: +- ovirt_storage_connection: id: 26915c96-92ff-47e5-9e77-b581db2f2d36 ''' @@ -230,6 +231,10 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) + + if module._name == 'ovirt_storage_connections': + module.deprecate("The 'ovirt_storage_connections' module is being renamed 'ovirt_storage_connection'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains.py b/lib/ansible/modules/cloud/ovirt/ovirt_storage_domain.py similarity index 97% rename from lib/ansible/modules/cloud/ovirt/ovirt_storage_domains.py rename to lib/ansible/modules/cloud/ovirt/ovirt_storage_domain.py index 8505e5db00..7f9fc57d31 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_storage_domain.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_storage_domains +module: ovirt_storage_domain short_description: Module to manage storage domains in oVirt/RHV version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -45,7 +45,7 @@ options: - "Should the storage domain be present/absent/maintenance/unattached/imported/update_ovf_store" - "I(imported) is supported since version 2.4." - "I(update_ovf_store) is supported since version 2.5, currently if C(wait) is (true), we don't wait for update." - choices: ['present', 'absent', 'maintenance', 'unattached', 'update_ovf_store'] + choices: ['present', 'absent', 'maintenance', 'unattached', 'imported', 'update_ovf_store'] default: present description: description: @@ -120,10 +120,12 @@ options: wipe_after_delete: description: - "Boolean flag which indicates whether the storage domain should wipe the data after delete." + type: bool version_added: "2.5" backup: description: - "Boolean flag which indicates whether the storage domain is configured as backup or not." + type: bool version_added: "2.5" critical_space_action_blocker: description: @@ -137,16 +139,18 @@ options: description: - "Logical remove of the storage domain. If I(true) retains the storage domain's data for import." - "This parameter is relevant only when C(state) is I(absent)." + type: bool format: description: - "If I(True) storage domain will be formatted after removing it from oVirt/RHV." - "This parameter is relevant only when C(state) is I(absent)." + type: bool discard_after_delete: description: - "If I(True) storage domain blocks will be discarded upon deletion. Enabled by default." - "This parameter is relevant only for block based storage domains." + type: bool version_added: 2.5 - extends_documentation_fragment: ovirt ''' @@ -155,7 +159,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Add data NFS storage domain -- ovirt_storage_domains: +- ovirt_storage_domain: name: data_nfs host: myhost data_center: mydatacenter @@ -164,7 +168,7 @@ EXAMPLES = ''' path: /path/data # Add data NFS storage domain with id for data center -- ovirt_storage_domains: +- ovirt_storage_domain: name: data_nfs host: myhost data_center: 11111 @@ -174,7 +178,7 @@ EXAMPLES = ''' mount_options: noexec,nosuid # Add data localfs storage domain -- ovirt_storage_domains: +- ovirt_storage_domain: name: data_localfs host: myhost data_center: mydatacenter @@ -182,7 +186,7 @@ EXAMPLES = ''' path: /path/to/data # Add data iSCSI storage domain: -- ovirt_storage_domains: +- ovirt_storage_domain: name: data_iscsi host: myhost data_center: mydatacenter @@ -199,7 +203,7 @@ EXAMPLES = ''' # Since Ansible 2.5 you can specify multiple targets for storage domain, # Add data iSCSI storage domain with multiple targets: -- ovirt_storage_domains: +- ovirt_storage_domain: name: data_iscsi host: myhost data_center: mydatacenter @@ -213,7 +217,7 @@ EXAMPLES = ''' discard_after_delete: True # Add data glusterfs storage domain -- ovirt_storage_domains: +- ovirt_storage_domain: name: glusterfs_1 host: myhost data_center: mydatacenter @@ -222,7 +226,7 @@ EXAMPLES = ''' path: /path/data # Create export NFS storage domain: -- ovirt_storage_domains: +- ovirt_storage_domain: name: myexportdomain domain_function: export host: myhost @@ -236,7 +240,7 @@ EXAMPLES = ''' warning_low_space: 5 # Import export NFS storage domain: -- ovirt_storage_domains: +- ovirt_storage_domain: state: imported domain_function: export host: myhost @@ -246,7 +250,7 @@ EXAMPLES = ''' path: /path/export # Import FCP storage domain: -- ovirt_storage_domains: +- ovirt_storage_domain: state: imported name: data_fcp host: myhost @@ -254,12 +258,12 @@ EXAMPLES = ''' fcp: {} # Update OVF_STORE: -- ovirt_storage_domains: +- ovirt_storage_domain: state: update_ovf_store name: domain # Create ISO NFS storage domain -- ovirt_storage_domains: +- ovirt_storage_domain: name: myiso domain_function: iso host: myhost @@ -269,7 +273,7 @@ EXAMPLES = ''' path: /path/iso # Remove storage domain -- ovirt_storage_domains: +- ovirt_storage_domain: state: absent name: mystorage_domain format: true @@ -621,6 +625,10 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) + + if module._name == 'ovirt_storage_domains': + module.deprecate("The 'ovirt_storage_domains' module is being renamed 'ovirt_storage_domain'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_storage_domain_facts.py similarity index 93% rename from lib/ansible/modules/cloud/ovirt/ovirt_storage_domains_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_storage_domain_facts.py index 5a242f3bac..1b90a72863 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_storage_domain_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_storage_domains_facts +module: ovirt_storage_domain_facts short_description: Retrieve facts about one or more oVirt/RHV storage domains author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -50,7 +50,7 @@ EXAMPLES = ''' # Gather facts about all storage domains which names start with C(data) and # belong to data center C(west): -- ovirt_storage_domains_facts: +- ovirt_storage_domain_facts: pattern: name=data* and datacenter=west - debug: var: ovirt_storage_domains @@ -80,6 +80,10 @@ def main(): pattern=dict(default='', required=False), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_storage_domains_facts': + module.deprecate("The 'ovirt_storage_domains_facts' module is being renamed 'ovirt_storage_domain_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_storage_templates_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_storage_template_facts.py similarity index 86% rename from lib/ansible/modules/cloud/ovirt/ovirt_storage_templates_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_storage_template_facts.py index 6930fd3fc5..d1e142b47b 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_storage_templates_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_storage_template_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_storage_templates_facts +module: ovirt_storage_template_facts short_description: Retrieve facts about one or more oVirt/RHV templates relate to a storage domain. author: "Maor Lipchuk" version_added: "2.4" @@ -40,7 +40,14 @@ options: 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: ovirt_facts ''' @@ -50,7 +57,7 @@ EXAMPLES = ''' # Gather facts about all Templates which relate to a storage domain and # are unregistered: -- ovirt_storage_templates_facts: +- ovirt_storage_template_facts: unregistered=True - debug: var: ovirt_storage_templates @@ -78,13 +85,15 @@ from ansible.module_utils.ovirt import ( def main(): argument_spec = ovirt_facts_full_argument_spec( - all_content=dict(default=False, type='bool'), - case_sensitive=dict(default=True, type='bool'), storage_domain=dict(default=None), max=dict(default=None, type='int'), unregistered=dict(default=False, type='bool'), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_storage_templates_facts': + module.deprecate("The 'ovirt_storage_templates_facts' module is being renamed 'ovirt_storage_template_facts'", version=2.8) + check_sdk(module) try: @@ -99,7 +108,7 @@ def main(): if module.params.get('unregistered'): templates = templates_service.list(unregistered=True) else: - templates = templates_service.list() + templates = templates_service.list(max=module.params['max']) module.exit_json( changed=False, ansible_facts=dict( diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_storage_vms_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_storage_vm_facts.py similarity index 88% rename from lib/ansible/modules/cloud/ovirt/ovirt_storage_vms_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_storage_vm_facts.py index 4a5586b95f..96f41c203e 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_storage_vms_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_storage_vm_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_storage_vms_facts +module: ovirt_storage_vm_facts short_description: Retrieve facts about one or more oVirt/RHV virtual machines relate to a storage domain. author: "Maor Lipchuk" version_added: "2.4" @@ -40,6 +40,14 @@ options: 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: ovirt_facts ''' @@ -77,13 +85,15 @@ from ansible.module_utils.ovirt import ( def main(): argument_spec = ovirt_facts_full_argument_spec( - all_content=dict(default=False, type='bool'), - case_sensitive=dict(default=True, type='bool'), storage_domain=dict(default=None), max=dict(default=None, type='int'), unregistered=dict(default=False, type='bool'), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_storage_vms_facts': + module.deprecate("The 'ovirt_storage_vms_facts' module is being renamed 'ovirt_storage_vm_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_tags.py b/lib/ansible/modules/cloud/ovirt/ovirt_tag.py similarity index 96% rename from lib/ansible/modules/cloud/ovirt/ovirt_tags.py rename to lib/ansible/modules/cloud/ovirt/ovirt_tag.py index 3edf2df4dc..c1fbf1cb92 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_tags.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_tag.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_tags +module: ovirt_tag short_description: Module to manage tags in oVirt/RHV version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -64,33 +64,33 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Create(if not exists) and assign tag to vms vm1 and vm2: -- ovirt_tags: +- ovirt_tag: name: mytag vms: - vm1 - vm2 # Attach a tag to VM 'vm1', keeping the rest already attached tags on VM: -- ovirt_tags: +- ovirt_tag: name: mytag state: attached vms: - vm3 # Detach a tag from VM 'vm1', keeping the rest already attached tags on VM: -- ovirt_tags: +- ovirt_tag: name: mytag state: detached vms: - vm3 # To detach all VMs from tag: -- ovirt_tags: +- ovirt_tag: name: mytag vms: [] # Remove tag -- ovirt_tags: +- ovirt_tag: state: absent name: mytag ''' @@ -205,7 +205,7 @@ def main(): choices=['present', 'absent', 'attached', 'detached'], default='present', ), - name=dict(default=None, required=True), + name=dict(required=True), description=dict(default=None), parent=dict(default=None), vms=dict(default=None, type='list'), @@ -215,6 +215,10 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) + + if module._name == 'ovirt_tags': + module.deprecate("The 'ovirt_tags' module is being renamed 'ovirt_tag'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_tags_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_tag_facts.py similarity index 94% rename from lib/ansible/modules/cloud/ovirt/ovirt_tags_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_tag_facts.py index 85b3b21ccc..c08c76b59d 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_tags_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_tag_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_tags_facts +module: ovirt_tag_facts short_description: Retrieve facts about one or more oVirt/RHV tags author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -45,7 +45,7 @@ options: host: description: - "Name of the host, which tags should be listed." -extends_documentation_fragment: ovirt +extends_documentation_fragment: ovirt_facts ''' EXAMPLES = ''' @@ -53,19 +53,19 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Gather facts about all tags, which names start with C(tag): -- ovirt_tags_facts: +- ovirt_tag_facts: name: tag* - debug: var: tags # Gather facts about all tags, which are assigned to VM C(postgres): -- ovirt_tags_facts: +- ovirt_tag_facts: vm: postgres - debug: var: tags # Gather facts about all tags, which are assigned to host C(west): -- ovirt_tags_facts: +- ovirt_tag_facts: host: west - debug: var: tags @@ -99,6 +99,10 @@ def main(): vm=dict(default=None), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_tags_facts': + module.deprecate("The 'ovirt_tags_facts' module is being renamed 'ovirt_tag_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_templates.py b/lib/ansible/modules/cloud/ovirt/ovirt_template.py similarity index 98% rename from lib/ansible/modules/cloud/ovirt/ovirt_templates.py rename to lib/ansible/modules/cloud/ovirt/ovirt_template.py index 1a043690d9..6e28024044 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_templates.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_template.py @@ -11,7 +11,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_templates +module: ovirt_template short_description: Module to manage virtual machine templates in oVirt/RHV version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -48,6 +48,7 @@ options: allow_partial_import: description: - "Boolean indication whether to allow partial registration of a template when C(state) is registered." + type: bool version_added: "2.4" vnic_profile_mappings: description: @@ -85,6 +86,7 @@ options: description: - "When C(state) is I(exported) this parameter indicates if the existing templates with the same name should be overwritten." + type: bool export_domain: description: - "When C(state) is I(exported) or I(imported) this parameter specifies the name of the @@ -116,6 +118,7 @@ options: - "If I(True) then the permissions of the VM (only the direct ones, not the inherited ones) will be copied to the created template." - "This parameter is used only when C(state) I(present)." + type: bool default: False seal: description: @@ -124,6 +127,7 @@ options: If I(true) subsequent virtual machines made from this template will avoid configuration inheritance." - "This parameter is used only when C(state) I(present)." default: False + type: bool version_added: "2.5" operating_system: description: @@ -161,7 +165,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Create template from vm -- ovirt_templates: +- ovirt_template: cluster: Default name: mytemplate vm: rhel7 @@ -169,7 +173,7 @@ EXAMPLES = ''' description: Test # Import template -- ovirt_templates: +- ovirt_template: state: imported name: mytemplate export_domain: myexport @@ -177,26 +181,26 @@ EXAMPLES = ''' cluster: mycluster # Remove template -- ovirt_templates: +- ovirt_template: state: absent name: mytemplate # Register template -- ovirt_templates: +- ovirt_template: state: registered storage_domain: mystorage cluster: mycluster name: mytemplate # Register template using id -- ovirt_templates: +- ovirt_template: state: registered storage_domain: mystorage cluster: mycluster id: 1111-1111-1111-1111 # Register template, allowing partial import -- ovirt_templates: +- ovirt_template: state: registered storage_domain: mystorage allow_partial_import: "True" @@ -204,7 +208,7 @@ EXAMPLES = ''' id: 1111-1111-1111-1111 # Register template with vnic profile mappings -- ovirt_templates: +- ovirt_template: state: registered storage_domain: mystorage cluster: mycluster @@ -218,7 +222,7 @@ EXAMPLES = ''' target_profile_id: 4444-4444-4444-4444 # Register template with mapping -- ovirt_templates: +- ovirt_template: state: registered storage_domain: mystorage cluster: mycluster @@ -234,7 +238,7 @@ EXAMPLES = ''' dest_name: cluster_B # Import image from Glance s a template -- ovirt_templates: +- ovirt_template: state: imported name: mytemplate image_disk: "centos7" @@ -439,7 +443,6 @@ def main(): cluster=dict(default=None), allow_partial_import=dict(default=None, type='bool'), cpu_profile=dict(default=None), - disks=dict(default=[], type='list'), clone_permissions=dict(type='bool'), export_domain=dict(default=None), storage_domain=dict(default=None), @@ -463,6 +466,10 @@ def main(): supports_check_mode=True, required_one_of=[['id', 'name']], ) + + if module._name == 'ovirt_templates': + module.deprecate("The 'ovirt_templates' module is being renamed 'ovirt_template'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_templates_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_template_facts.py similarity index 94% rename from lib/ansible/modules/cloud/ovirt/ovirt_templates_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_template_facts.py index 10e613fd5d..73af9533d1 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_templates_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_template_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_templates_facts +module: ovirt_template_facts short_description: Retrieve facts about one or more oVirt/RHV templates author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -50,7 +50,7 @@ EXAMPLES = ''' # Gather facts about all templates which names start with C(centos) and # belongs to data center C(west): -- ovirt_templates_facts: +- ovirt_template_facts: pattern: name=centos* and datacenter=west - debug: var: ovirt_templates @@ -80,6 +80,10 @@ def main(): pattern=dict(default='', required=False), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_templates_facts': + module.deprecate("The 'ovirt_templates_facts' module is being renamed 'ovirt_template_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_users.py b/lib/ansible/modules/cloud/ovirt/ovirt_user.py similarity index 90% rename from lib/ansible/modules/cloud/ovirt/ovirt_users.py rename to lib/ansible/modules/cloud/ovirt/ovirt_user.py index f0121c2f38..55fc0c894e 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_users.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_user.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_users +module: ovirt_user short_description: Module to manage users in oVirt/RHV version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -47,6 +47,10 @@ options: - "Authorization provider of the user. In previous versions of oVirt/RHV known as domain." required: true aliases: ['domain'] + namespace: + description: + - "Namespace where the user resides. When using the authorization provider that stores users in the LDAP server, + this attribute equals the naming context of the LDAP server." extends_documentation_fragment: ovirt ''' @@ -55,18 +59,18 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Add user user1 from authorization provider example.com-authz -- ovirt_users: +- ovirt_user: name: user1 domain: example.com-authz # Add user user1 from authorization provider example.com-authz # In case of Active Directory specify UPN: -- ovirt_users: +- ovirt_user: name: user1@ad2.example.com domain: example.com-authz # Remove user user1 with authorization provider example.com-authz -- ovirt_users: +- ovirt_user: state: absent name: user1 authz_name: example.com-authz @@ -103,7 +107,7 @@ from ansible.module_utils.ovirt import ( def username(module): - return '{}@{}'.format(module.params['name'], module.params['authz_name']) + return '{0}@{1}'.format(module.params['name'], module.params['authz_name']) class UsersModule(BaseModule): @@ -133,6 +137,10 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) + + if module._name == 'ovirt_users': + module.deprecate("The 'ovirt_users' module is being renamed 'ovirt_user'", version=2.8) + check_sdk(module) check_params(module) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_users_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_user_facts.py similarity index 94% rename from lib/ansible/modules/cloud/ovirt/ovirt_users_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_user_facts.py index 2cd8e85480..655bdd953c 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_users_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_user_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_users_facts +module: ovirt_user_facts short_description: Retrieve facts about one or more oVirt/RHV users author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -48,7 +48,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Gather facts about all users which first names start with C(john): -- ovirt_users_facts: +- ovirt_user_facts: pattern: name=john* - debug: var: ovirt_users @@ -78,6 +78,10 @@ def main(): pattern=dict(default='', required=False), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_users_facts': + module.deprecate("The 'ovirt_users_facts' module is being renamed 'ovirt_user_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vms.py b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py similarity index 98% rename from lib/ansible/modules/cloud/ovirt/ovirt_vms.py rename to lib/ansible/modules/cloud/ovirt/ovirt_vm.py index 4ba75bea5f..288b75a4a8 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vms.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py @@ -10,7 +10,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_vms +module: ovirt_vm short_description: Module to manage Virtual Machines in oVirt/RHV version_added: "2.2" author: @@ -46,6 +46,7 @@ options: allow_partial_import: description: - Boolean indication whether to allow partial registration of Virtual Machine when C(state) is registered. + type: bool version_added: "2.4" vnic_profile_mappings: description: @@ -105,6 +106,7 @@ options: reassign_bad_macs: description: - "Boolean indication whether to reassign bad macs when C(state) is registered." + type: bool version_added: "2.5" template: description: @@ -186,47 +188,13 @@ options: description: - Operating system of the Virtual Machine. - Default value is set by oVirt/RHV engine. - choices: - - debian_7 - - freebsd - - freebsdx64 - - other - - other_linux - - other_linux_ppc64 - - other_ppc64 - - rhel_3 - - rhel_4 - - rhel_4x64 - - rhel_5 - - rhel_5x64 - - rhel_6 - - rhel_6x64 - - rhel_6_ppc64 - - rhel_7x64 - - rhel_7_ppc64 - - sles_11 - - sles_11_ppc64 - - ubuntu_12_04 - - ubuntu_12_10 - - ubuntu_13_04 - - ubuntu_13_10 - - ubuntu_14_04 - - ubuntu_14_04_ppc64 - - windows_10 - - windows_10x64 - - windows_2003 - - windows_2003x64 - - windows_2008 - - windows_2008x64 - - windows_2008r2x64 - - windows_2008R2x64 - - windows_2012x64 - - windows_2012R2x64 - - windows_7 - - windows_7x64 - - windows_8 - - windows_8x64 - - windows_xp + - "Possible values: debian_7, freebsd, freebsdx64, other, other_linux, + other_linux_ppc64, other_ppc64, rhel_3, rhel_4, rhel_4x64, rhel_5, rhel_5x64, + rhel_6, rhel_6x64, rhel_6_ppc64, rhel_7x64, rhel_7_ppc64, sles_11, sles_11_ppc64, + ubuntu_12_04, ubuntu_12_10, ubuntu_13_04, ubuntu_13_10, ubuntu_14_04, ubuntu_14_04_ppc64, + windows_10, windows_10x64, windows_2003, windows_2003x64, windows_2008, windows_2008x64, + windows_2008r2x64, windows_2008R2x64, windows_2012x64, windows_2012R2x64, windows_7, + windows_7x64, windows_8, windows_8x64, windows_xp" boot_devices: description: - List of boot devices which should be used to boot. For example C([ cdrom, hd ]). @@ -235,18 +203,22 @@ options: boot_menu: description: - "I(True) enable menu to select boot device, I(False) to disable it. By default is chosen by oVirt/RHV engine." + type: bool version_added: "2.5" usb_support: description: - "I(True) enable USB support, I(False) to disable it. By default is chosen by oVirt/RHV engine." + type: bool version_added: "2.5" serial_console: description: - "I(True) enable VirtIO serial console, I(False) to disable it. By default is chosen by oVirt/RHV engine." + type: bool version_added: "2.5" sso: description: - "I(True) enable Single Sign On by Guest Agent, I(False) to disable it. By default is chosen by oVirt/RHV engine." + type: bool version_added: "2.5" host: description: @@ -282,11 +254,13 @@ options: - If I(yes) Virtual Machine will be set as delete protected. - If I(no) Virtual Machine won't be set as delete protected. - If no value is passed, default value is set by oVirt/RHV engine. + type: bool stateless: description: - If I(yes) Virtual Machine will be set as stateless. - If I(no) Virtual Machine will be unset as stateless. - If no value is passed, default value is set by oVirt/RHV engine. + type: bool clone: description: - If I(yes) then the disks of the created virtual machine will be cloned and independent of the template. @@ -382,6 +356,7 @@ options: description: - "If I(true) the C(cloud_init) or C(sysprep) parameters will be saved for the virtual machine and won't be virtual machine won't be started as run-once." + type: bool version_added: "2.5" aliases: [ 'sysprep_persist' ] kernel_path: @@ -423,6 +398,7 @@ options: - C(vm) - Sets the Virtual Machine's UUID as its serial number. - C(host) - Sets the host's UUID as the Virtual Machine's serial number. - C(custom) - Allows you to specify a custom serial number in C(serial_policy_value). + choices: ['vm', 'host', 'custom'] version_added: "2.3" serial_policy_value: description: @@ -499,6 +475,7 @@ options: - "If I(true), in addition return I(remote_vv_file) inside I(vm) dictionary, which contains compatible content for remote-viewer application. Works only C(state) is I(running)." version_added: "2.7" + type: bool cpu_pinning: description: - "CPU Pinning topology to map virtual machine CPU to host CPU." @@ -509,10 +486,12 @@ options: soundcard_enabled: description: - "If I(true), the sound card is added to the virtual machine." + type: bool version_added: "2.5" smartcard_enabled: description: - "If I(true), use smart card authentication." + type: bool version_added: "2.5" io_threads: description: @@ -523,12 +502,14 @@ options: - "If I(true), use memory ballooning." - "Memory balloon is a guest device, which may be used to re-distribute / reclaim the host memory based on VM needs in a dynamic way. In this way it's possible to create memory over commitment states." + type: bool version_added: "2.5" numa_tune_mode: description: - "Set how the memory allocation for NUMA nodes of this VM is applied (relevant if NUMA nodes are set for this VM)." - "It can be one of the following: I(interleave), I(preferred) or I(strict)." - "If no value is passed, default value is set by oVirt/RHV engine." + choices: ['interleave', 'preferred', 'strict'] version_added: "2.6" numa_nodes: description: @@ -592,28 +573,28 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: - name: Creates a new Virtual Machine from template named 'rhel7_template' - ovirt_vms: + ovirt_vm: state: present name: myvm template: rhel7_template cluster: mycluster - name: Register VM - ovirt_vms: + ovirt_vm: state: registered storage_domain: mystorage cluster: mycluster name: myvm - name: Register VM using id - ovirt_vms: + ovirt_vm: state: registered storage_domain: mystorage cluster: mycluster id: 1111-1111-1111-1111 - name: Register VM, allowing partial import - ovirt_vms: + ovirt_vm: state: registered storage_domain: mystorage allow_partial_import: "True" @@ -621,7 +602,7 @@ EXAMPLES = ''' id: 1111-1111-1111-1111 - name: Register VM with vnic profile mappings and reassign bad macs - ovirt_vms: + ovirt_vm: state: registered storage_domain: mystorage cluster: mycluster @@ -636,7 +617,7 @@ EXAMPLES = ''' reassign_bad_macs: "True" - name: Register VM with mappings - ovirt_vms: + ovirt_vm: state: registered storage_domain: mystorage cluster: mycluster @@ -671,7 +652,7 @@ EXAMPLES = ''' dest_name: cluster_B - name: Creates a stateless VM which will always use latest template version - ovirt_vms: + ovirt_vm: name: myvm template: rhel7 cluster: mycluster @@ -680,7 +661,7 @@ EXAMPLES = ''' # Creates a new server rhel7 Virtual Machine from Blank template # on brq01 cluster with 2GiB memory and 2 vcpu cores/sockets # and attach bootable disk with name rhel7_disk and attach virtio NIC -- ovirt_vms: +- ovirt_vm: state: present cluster: brq01 name: myvm @@ -697,7 +678,7 @@ EXAMPLES = ''' - name: nic1 - name: Run VM with cloud init - ovirt_vms: + ovirt_vm: name: rhel7 template: rhel7 cluster: Default @@ -722,7 +703,7 @@ EXAMPLES = ''' root_password: super_password - name: Run VM with cloud init, with multiple network interfaces - ovirt_vms: + ovirt_vm: name: rhel7_4 template: rhel7 cluster: mycluster @@ -738,7 +719,7 @@ EXAMPLES = ''' nic_on_boot: true - name: Run VM with sysprep - ovirt_vms: + ovirt_vm: name: windows2012R2_AD template: windows2012R2 cluster: Default @@ -750,47 +731,47 @@ EXAMPLES = ''' root_password: SuperPassword123 - name: Migrate/Run VM to/on host named 'host1' - ovirt_vms: + ovirt_vm: state: running name: myvm host: host1 - name: Change VMs CD - ovirt_vms: + ovirt_vm: name: myvm cd_iso: drivers.iso - name: Eject VMs CD - ovirt_vms: + ovirt_vm: name: myvm cd_iso: '' - name: Boot VM from CD - ovirt_vms: + ovirt_vm: name: myvm cd_iso: centos7_x64.iso boot_devices: - cdrom - name: Stop vm - ovirt_vms: + ovirt_vm: state: stopped name: myvm - name: Upgrade memory to already created VM - ovirt_vms: + ovirt_vm: name: myvm memory: 4GiB - name: Hot plug memory to already created and running VM (VM won't be restarted) - ovirt_vms: + ovirt_vm: name: myvm memory: 4GiB # Create/update a VM to run with two vNUMA nodes and pin them to physical NUMA nodes as follows: # vnuma index 0-> numa index 0, vnuma index 1-> numa index 1 - name: Create a VM to run with two vNUMA nodes - ovirt_vms: + ovirt_vm: name: myvm cluster: mycluster numa_tune_mode: "interleave" @@ -805,7 +786,7 @@ EXAMPLES = ''' numa_node_pins: [1] - name: Update an existing VM to run without previously created vNUMA nodes (i.e. remove all vNUMA nodes+NUMA pinning setting) - ovirt_vms: + ovirt_vm: name: myvm cluster: mycluster state: "present" @@ -816,14 +797,14 @@ EXAMPLES = ''' # When change on the VM needs restart of the VM, use next_run state, # The VM will be updated and rebooted if there are any changes. # If present state would be used, VM won't be restarted. -- ovirt_vms: +- ovirt_vm: state: next_run name: myvm boot_devices: - network - name: Import virtual machine from VMware - ovirt_vms: + ovirt_vm: state: stopped cluster: mycluster name: vmware_win10 @@ -837,7 +818,7 @@ EXAMPLES = ''' password: password - name: Create vm from template and create all disks on specific storage domain - ovirt_vms: + ovirt_vm: name: vm_test cluster: mycluster template: mytemplate @@ -846,7 +827,7 @@ EXAMPLES = ''' - name: nic1 - name: Remove VM, if VM is running it will be stopped - ovirt_vms: + ovirt_vm: state: absent name: myvm @@ -855,7 +836,7 @@ EXAMPLES = ''' - ovirt_quotas_facts: data_center: Default name: myquota -- ovirt_vms: +- ovirt_vm: name: myvm sso: False boot_menu: True @@ -864,7 +845,7 @@ EXAMPLES = ''' quota_id: "{{ ovirt_quotas[0]['id'] }}" - name: Create a VM that has the console configured for both Spice and VNC - ovirt_vms: + ovirt_vm: name: myvm template: mytemplate cluster: mycluster @@ -1849,7 +1830,7 @@ def control_state(vm, vms_service, module): vm.status == otypes.VmStatus.UNKNOWN ): # Invalid states: - module.fail_json(msg="Not possible to control VM, if it's in '{}' status".format(vm.status)) + module.fail_json(msg="Not possible to control VM, if it's in '{0}' status".format(vm.status)) elif vm.status == otypes.VmStatus.POWERING_DOWN: if (force and state == 'stopped') or state == 'absent': vm_service.stop() @@ -1890,7 +1871,7 @@ def main(): type=dict(type='str', choices=['server', 'desktop', 'high_performance']), operating_system=dict(type='str'), cd_iso=dict(type='str'), - boot_devices=dict(type='list'), + boot_devices=dict(type='list', choices=['cdrom', 'hd', 'network']), vnic_profile_mappings=dict(default=[], type='list'), cluster_mappings=dict(default=[], type='list'), role_mappings=dict(default=[], type='list'), @@ -1951,6 +1932,10 @@ def main(): supports_check_mode=True, required_one_of=[['id', 'name']], ) + + if module._name == 'ovirt_vms': + module.deprecate("The 'ovirt_vms' module is being renamed 'ovirt_vm'", version=2.8) + check_sdk(module) check_params(module) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vms_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_vm_facts.py similarity index 94% rename from lib/ansible/modules/cloud/ovirt/ovirt_vms_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_vm_facts.py index df98581e18..be20186729 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vms_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vm_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_vms_facts +module: ovirt_vm_facts short_description: Retrieve facts about one or more oVirt/RHV virtual machines author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -45,9 +45,12 @@ options: description: - "If I(true) all the attributes of the virtual machines should be included in the response." + type: bool 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." @@ -60,7 +63,7 @@ EXAMPLES = ''' # Gather facts about all VMs which names start with C(centos) and # belong to cluster C(west): -- ovirt_vms_facts: +- ovirt_vm_facts: pattern: name=centos* and cluster=west - debug: var: ovirt_vms @@ -93,6 +96,10 @@ def main(): max=dict(default=None, type='int'), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_vms_facts': + module.deprecate("The 'ovirt_vms_facts' module is being renamed 'ovirt_vm_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vmpools.py b/lib/ansible/modules/cloud/ovirt/ovirt_vmpool.py similarity index 95% rename from lib/ansible/modules/cloud/ovirt/ovirt_vmpools.py rename to lib/ansible/modules/cloud/ovirt/ovirt_vmpool.py index 726cdade65..2255d0b72b 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vmpools.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vmpool.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_vmpools +module: ovirt_vmpool short_description: Module to manage VM pools in oVirt/RHV version_added: "2.3" author: "Ondra Machacek (@machacekondra)" @@ -37,6 +37,9 @@ options: description: - "Name of the VM pool to manage." required: true + comment: + description: + - Comment of the Virtual Machine pool. state: description: - "Should the VM pool be present/absent." @@ -82,7 +85,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Create VM pool from template -- ovirt_vmpools: +- ovirt_vmpool: cluster: mycluster name: myvmpool template: rhel7 @@ -91,7 +94,7 @@ EXAMPLES = ''' vm_per_user: 1 # Remove vmpool, note that all VMs in pool will be stopped and removed: -- ovirt_vmpools: +- ovirt_vmpool: state: absent name: myvmpool ''' @@ -167,7 +170,7 @@ def main(): choices=['present', 'absent'], default='present', ), - name=dict(default=None, required=True), + name=dict(required=True), template=dict(default=None), cluster=dict(default=None), description=dict(default=None), @@ -181,6 +184,10 @@ def main(): argument_spec=argument_spec, supports_check_mode=True, ) + + if module._name == 'ovirt_vmpools': + module.deprecate("The 'ovirt_vmpools' module is being renamed 'ovirt_vmpool'", version=2.8) + check_sdk(module) check_params(module) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_vmpool_facts.py similarity index 94% rename from lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py rename to lib/ansible/modules/cloud/ovirt/ovirt_vmpool_facts.py index c6af39ee1e..d3736744c9 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vmpool_facts.py @@ -26,7 +26,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: ovirt_vmpools_facts +module: ovirt_vmpool_facts short_description: Retrieve facts about one or more oVirt/RHV vmpools author: "Ondra Machacek (@machacekondra)" version_added: "2.3" @@ -48,7 +48,7 @@ EXAMPLES = ''' # look at ovirt_auth module to see how to reuse authentication: # Gather facts about all vm pools which names start with C(centos): -- ovirt_vmpools_facts: +- ovirt_vmpool_facts: pattern: name=centos* - debug: var: ovirt_vmpools @@ -78,6 +78,10 @@ def main(): pattern=dict(default='', required=False), ) module = AnsibleModule(argument_spec) + + if module._name == 'ovirt_vmpools_facts': + module.deprecate("The 'ovirt_vmpools_facts' module is being renamed 'ovirt_vmpool_facts'", version=2.8) + check_sdk(module) try: diff --git a/lib/ansible/utils/module_docs_fragments/ovirt.py b/lib/ansible/utils/module_docs_fragments/ovirt.py index 524e3e7bb0..bcea8d433c 100644 --- a/lib/ansible/utils/module_docs_fragments/ovirt.py +++ b/lib/ansible/utils/module_docs_fragments/ovirt.py @@ -27,12 +27,15 @@ options: wait: description: - "I(True) if the module should wait for the entity to get into desired state." + default: true + type: bool fetch_nested: description: - "If I(True) the module will fetch additional data from the API." - "It will fetch IDs of the VMs disks, snapshots, etc. User can configure to fetch other attributes of the nested entities by specifying C(nested_attributes)." version_added: "2.3" + type: bool nested_attributes: description: - "Specifies list of the attributes which should be fetched from the API." diff --git a/lib/ansible/utils/module_docs_fragments/ovirt_facts.py b/lib/ansible/utils/module_docs_fragments/ovirt_facts.py index 24c2537b75..564898ef55 100644 --- a/lib/ansible/utils/module_docs_fragments/ovirt_facts.py +++ b/lib/ansible/utils/module_docs_fragments/ovirt_facts.py @@ -30,6 +30,7 @@ options: - "It will fetch IDs of the VMs disks, snapshots, etc. User can configure to fetch other attributes of the nested entities by specifying C(nested_attributes)." version_added: "2.3" + type: bool nested_attributes: description: - "Specifies list of the attributes which should be fetched from the API." diff --git a/test/sanity/pylint/ignore.txt b/test/sanity/pylint/ignore.txt index ae6326301a..786d90293c 100644 --- a/test/sanity/pylint/ignore.txt +++ b/test/sanity/pylint/ignore.txt @@ -17,8 +17,6 @@ lib/ansible/modules/cloud/lxd/lxd_container.py ansible-format-automatic-specific lib/ansible/modules/cloud/lxd/lxd_profile.py ansible-format-automatic-specification lib/ansible/modules/cloud/misc/proxmox_kvm.py ansible-format-automatic-specification lib/ansible/modules/cloud/misc/serverless.py ansible-format-automatic-specification -lib/ansible/modules/cloud/ovirt/ovirt_users.py ansible-format-automatic-specification -lib/ansible/modules/cloud/ovirt/ovirt_vms.py ansible-format-automatic-specification lib/ansible/modules/cloud/univention/udm_dns_record.py ansible-format-automatic-specification lib/ansible/modules/cloud/univention/udm_dns_zone.py ansible-format-automatic-specification lib/ansible/modules/cloud/univention/udm_group.py ansible-format-automatic-specification diff --git a/test/sanity/validate-modules/ignore.txt b/test/sanity/validate-modules/ignore.txt index 0deac94080..8d5c99955d 100644 --- a/test/sanity/validate-modules/ignore.txt +++ b/test/sanity/validate-modules/ignore.txt @@ -300,49 +300,32 @@ lib/ansible/modules/cloud/openstack/os_subnets_facts.py E322 lib/ansible/modules/cloud/openstack/os_subnets_facts.py E323 lib/ansible/modules/cloud/openstack/os_volume.py E322 lib/ansible/modules/cloud/openstack/os_zone.py E326 -lib/ansible/modules/cloud/ovirt/ovirt_affinity_group.py E324 -lib/ansible/modules/cloud/ovirt/ovirt_affinity_group.py E325 lib/ansible/modules/cloud/ovirt/ovirt_affinity_label.py E317 -lib/ansible/modules/cloud/ovirt/ovirt_affinity_label.py E324 -lib/ansible/modules/cloud/ovirt/ovirt_affinity_label.py E325 -lib/ansible/modules/cloud/ovirt/ovirt_affinity_label_facts.py E325 -lib/ansible/modules/cloud/ovirt/ovirt_api_facts.py E325 lib/ansible/modules/cloud/ovirt/ovirt_auth.py E322 lib/ansible/modules/cloud/ovirt/ovirt_auth.py E324 lib/ansible/modules/cloud/ovirt/ovirt_auth.py E325 lib/ansible/modules/cloud/ovirt/ovirt_cluster.py E317 lib/ansible/modules/cloud/ovirt/ovirt_cluster.py E322 -lib/ansible/modules/cloud/ovirt/ovirt_cluster.py E324 lib/ansible/modules/cloud/ovirt/ovirt_cluster.py E325 lib/ansible/modules/cloud/ovirt/ovirt_cluster.py E326 -lib/ansible/modules/cloud/ovirt/ovirt_cluster_facts.py E325 lib/ansible/modules/cloud/ovirt/ovirt_datacenter.py E317 -lib/ansible/modules/cloud/ovirt/ovirt_datacenter.py E324 lib/ansible/modules/cloud/ovirt/ovirt_datacenter.py E325 -lib/ansible/modules/cloud/ovirt/ovirt_datacenter_facts.py E325 lib/ansible/modules/cloud/ovirt/ovirt_disk.py E322 lib/ansible/modules/cloud/ovirt/ovirt_disk.py E324 lib/ansible/modules/cloud/ovirt/ovirt_disk.py E325 lib/ansible/modules/cloud/ovirt/ovirt_disk.py E326 -lib/ansible/modules/cloud/ovirt/ovirt_disk_facts.py E325 lib/ansible/modules/cloud/ovirt/ovirt_external_provider.py E317 lib/ansible/modules/cloud/ovirt/ovirt_external_provider.py E322 lib/ansible/modules/cloud/ovirt/ovirt_external_provider.py E324 lib/ansible/modules/cloud/ovirt/ovirt_external_provider.py E325 lib/ansible/modules/cloud/ovirt/ovirt_external_provider_facts.py E317 lib/ansible/modules/cloud/ovirt/ovirt_external_provider_facts.py E322 -lib/ansible/modules/cloud/ovirt/ovirt_external_provider_facts.py E325 -lib/ansible/modules/cloud/ovirt/ovirt_group.py E324 -lib/ansible/modules/cloud/ovirt/ovirt_group.py E325 -lib/ansible/modules/cloud/ovirt/ovirt_group_facts.py E325 lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py E317 lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py E322 lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py E324 lib/ansible/modules/cloud/ovirt/ovirt_host_networks.py E325 lib/ansible/modules/cloud/ovirt/ovirt_host_pm.py E317 -lib/ansible/modules/cloud/ovirt/ovirt_host_pm.py E324 lib/ansible/modules/cloud/ovirt/ovirt_host_pm.py E325 -lib/ansible/modules/cloud/ovirt/ovirt_host_storage_facts.py E325 lib/ansible/modules/cloud/ovirt/ovirt_hosts.py E324 lib/ansible/modules/cloud/ovirt/ovirt_hosts.py E325 lib/ansible/modules/cloud/ovirt/ovirt_hosts.py E326