mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 06:30:19 -07:00
Ovirt add rename functionality (#44951)
* add renaming of ovirt * add renaming func to ovirt cluster * ovirt update examples in docs
This commit is contained in:
parent
95649dc793
commit
2a3f3382fd
12 changed files with 128 additions and 3 deletions
|
@ -18,6 +18,10 @@ author: "Ondra Machacek (@machacekondra)"
|
||||||
description:
|
description:
|
||||||
- "Module to manage clusters in oVirt/RHV"
|
- "Module to manage clusters in oVirt/RHV"
|
||||||
options:
|
options:
|
||||||
|
id:
|
||||||
|
description:
|
||||||
|
- "ID of the cluster to manage."
|
||||||
|
version_added: "2.8"
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- "Name of the cluster to manage."
|
- "Name of the cluster to manage."
|
||||||
|
@ -266,6 +270,11 @@ EXAMPLES = '''
|
||||||
- ovirt_cluster:
|
- ovirt_cluster:
|
||||||
state: absent
|
state: absent
|
||||||
name: mycluster
|
name: mycluster
|
||||||
|
|
||||||
|
# Change cluster Name
|
||||||
|
- ovirt_cluster:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new_cluster_name"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -381,6 +390,7 @@ class ClustersModule(BaseModule):
|
||||||
def build_entity(self):
|
def build_entity(self):
|
||||||
sched_policy = self._get_sched_policy()
|
sched_policy = self._get_sched_policy()
|
||||||
return otypes.Cluster(
|
return otypes.Cluster(
|
||||||
|
id=self.param('id'),
|
||||||
name=self.param('name'),
|
name=self.param('name'),
|
||||||
comment=self.param('comment'),
|
comment=self.param('comment'),
|
||||||
description=self.param('description'),
|
description=self.param('description'),
|
||||||
|
@ -543,6 +553,7 @@ class ClustersModule(BaseModule):
|
||||||
|
|
||||||
return (
|
return (
|
||||||
check_custom_scheduling_policy_properties() and
|
check_custom_scheduling_policy_properties() and
|
||||||
|
equal(self.param('name'), entity.name) and
|
||||||
equal(self.param('comment'), entity.comment) and
|
equal(self.param('comment'), entity.comment) and
|
||||||
equal(self.param('description'), entity.description) and
|
equal(self.param('description'), entity.description) and
|
||||||
equal(self.param('switch_type'), str(entity.switch_type)) and
|
equal(self.param('switch_type'), str(entity.switch_type)) and
|
||||||
|
@ -599,6 +610,7 @@ def main():
|
||||||
default='present',
|
default='present',
|
||||||
),
|
),
|
||||||
name=dict(default=None, required=True),
|
name=dict(default=None, required=True),
|
||||||
|
id=dict(default=None),
|
||||||
ballooning=dict(default=None, type='bool', aliases=['balloon']),
|
ballooning=dict(default=None, type='bool', aliases=['balloon']),
|
||||||
gluster=dict(default=None, type='bool'),
|
gluster=dict(default=None, type='bool'),
|
||||||
virt=dict(default=None, type='bool'),
|
virt=dict(default=None, type='bool'),
|
||||||
|
|
|
@ -18,6 +18,10 @@ author: "Ondra Machacek (@machacekondra)"
|
||||||
description:
|
description:
|
||||||
- "Module to manage data centers in oVirt/RHV"
|
- "Module to manage data centers in oVirt/RHV"
|
||||||
options:
|
options:
|
||||||
|
id:
|
||||||
|
description:
|
||||||
|
- "ID of the datacenter to manage."
|
||||||
|
version_added: "2.8"
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- "Name of the data center to manage."
|
- "Name of the data center to manage."
|
||||||
|
@ -77,6 +81,11 @@ EXAMPLES = '''
|
||||||
- ovirt_datacenter:
|
- ovirt_datacenter:
|
||||||
state: absent
|
state: absent
|
||||||
name: mydatacenter
|
name: mydatacenter
|
||||||
|
|
||||||
|
# Change Datacenter Name
|
||||||
|
- ovirt_datacenter:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new_datacenter_name"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -140,6 +149,7 @@ class DatacentersModule(BaseModule):
|
||||||
def build_entity(self):
|
def build_entity(self):
|
||||||
return otypes.DataCenter(
|
return otypes.DataCenter(
|
||||||
name=self._module.params['name'],
|
name=self._module.params['name'],
|
||||||
|
id=self._module.params['id'],
|
||||||
comment=self._module.params['comment'],
|
comment=self._module.params['comment'],
|
||||||
description=self._module.params['description'],
|
description=self._module.params['description'],
|
||||||
mac_pool=otypes.MacPool(
|
mac_pool=otypes.MacPool(
|
||||||
|
@ -162,6 +172,7 @@ class DatacentersModule(BaseModule):
|
||||||
equal(getattr(self._get_mac_pool(), 'id', None), getattr(entity.mac_pool, 'id', None)) and
|
equal(getattr(self._get_mac_pool(), 'id', None), getattr(entity.mac_pool, 'id', None)) and
|
||||||
equal(self._module.params.get('comment'), entity.comment) and
|
equal(self._module.params.get('comment'), entity.comment) and
|
||||||
equal(self._module.params.get('description'), entity.description) and
|
equal(self._module.params.get('description'), entity.description) and
|
||||||
|
equal(self._module.params.get('name'), entity.name) and
|
||||||
equal(self._module.params.get('quota_mode'), str(entity.quota_mode)) and
|
equal(self._module.params.get('quota_mode'), str(entity.quota_mode)) and
|
||||||
equal(self._module.params.get('local'), entity.local) and
|
equal(self._module.params.get('local'), entity.local) and
|
||||||
equal(minor, self.__get_minor(entity.version)) and
|
equal(minor, self.__get_minor(entity.version)) and
|
||||||
|
@ -178,6 +189,7 @@ def main():
|
||||||
name=dict(default=None, required=True),
|
name=dict(default=None, required=True),
|
||||||
description=dict(default=None),
|
description=dict(default=None),
|
||||||
local=dict(type='bool'),
|
local=dict(type='bool'),
|
||||||
|
id=dict(default=None),
|
||||||
compatibility_version=dict(default=None),
|
compatibility_version=dict(default=None),
|
||||||
quota_mode=dict(choices=['disabled', 'audit', 'enabled']),
|
quota_mode=dict(choices=['disabled', 'audit', 'enabled']),
|
||||||
comment=dict(default=None),
|
comment=dict(default=None),
|
||||||
|
|
|
@ -185,7 +185,7 @@ EXAMPLES = '''
|
||||||
- ovirt_disk:
|
- ovirt_disk:
|
||||||
id: 00000000-0000-0000-0000-000000000000
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
storage_domain: data
|
storage_domain: data
|
||||||
name: "new disk name"
|
name: "new_disk_name"
|
||||||
vm_name: rhel7
|
vm_name: rhel7
|
||||||
|
|
||||||
# Upload local image to disk and attach it to vm:
|
# Upload local image to disk and attach it to vm:
|
||||||
|
|
|
@ -18,6 +18,10 @@ author: "Ondra Machacek (@machacekondra)"
|
||||||
description:
|
description:
|
||||||
- "Module to manage hosts in oVirt/RHV"
|
- "Module to manage hosts in oVirt/RHV"
|
||||||
options:
|
options:
|
||||||
|
id:
|
||||||
|
description:
|
||||||
|
- "ID of the host to manage."
|
||||||
|
version_added: "2.8"
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- "Name of the host to manage."
|
- "Name of the host to manage."
|
||||||
|
@ -218,6 +222,11 @@ EXAMPLES = '''
|
||||||
state: absent
|
state: absent
|
||||||
name: myhost
|
name: myhost
|
||||||
force: True
|
force: True
|
||||||
|
|
||||||
|
# Change host Name
|
||||||
|
- ovirt_host:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new host name"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -263,6 +272,7 @@ class HostsModule(BaseModule):
|
||||||
|
|
||||||
def build_entity(self):
|
def build_entity(self):
|
||||||
return otypes.Host(
|
return otypes.Host(
|
||||||
|
id=self._module.params.get('id'),
|
||||||
name=self.param('name'),
|
name=self.param('name'),
|
||||||
cluster=otypes.Cluster(
|
cluster=otypes.Cluster(
|
||||||
name=self.param('cluster')
|
name=self.param('cluster')
|
||||||
|
@ -295,6 +305,7 @@ class HostsModule(BaseModule):
|
||||||
equal(self.param('comment'), entity.comment) and
|
equal(self.param('comment'), entity.comment) and
|
||||||
equal(self.param('kdump_integration'), 'enabled' if entity.power_management.kdump_detection else 'disabled') and
|
equal(self.param('kdump_integration'), 'enabled' if entity.power_management.kdump_detection else 'disabled') and
|
||||||
equal(self.param('spm_priority'), entity.spm.priority) and
|
equal(self.param('spm_priority'), entity.spm.priority) and
|
||||||
|
equal(self.param('name'), entity.name) and
|
||||||
equal(self.param('power_management_enabled'), entity.power_management.enabled) and
|
equal(self.param('power_management_enabled'), entity.power_management.enabled) and
|
||||||
equal(self.param('override_display'), getattr(entity.display, 'address', None)) and
|
equal(self.param('override_display'), getattr(entity.display, 'address', None)) and
|
||||||
equal(
|
equal(
|
||||||
|
@ -400,6 +411,7 @@ def main():
|
||||||
default='present',
|
default='present',
|
||||||
),
|
),
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
|
id=dict(default=None),
|
||||||
comment=dict(default=None),
|
comment=dict(default=None),
|
||||||
cluster=dict(default=None),
|
cluster=dict(default=None),
|
||||||
address=dict(default=None),
|
address=dict(default=None),
|
||||||
|
|
|
@ -18,6 +18,10 @@ author: "Ondra Machacek (@machacekondra)"
|
||||||
description:
|
description:
|
||||||
- "This module manage MAC pools in oVirt/RHV."
|
- "This module manage MAC pools in oVirt/RHV."
|
||||||
options:
|
options:
|
||||||
|
id:
|
||||||
|
description:
|
||||||
|
- "ID of the mac pool to manage."
|
||||||
|
version_added: "2.8"
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- "Name of the MAC pool to manage."
|
- "Name of the MAC pool to manage."
|
||||||
|
@ -58,6 +62,11 @@ EXAMPLES = '''
|
||||||
- ovirt_mac_pool:
|
- ovirt_mac_pool:
|
||||||
state: absent
|
state: absent
|
||||||
name: mymacpool
|
name: mymacpool
|
||||||
|
|
||||||
|
# Change MAC pool Name
|
||||||
|
- ovirt_nic:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new_mac_pool_name"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -95,6 +104,7 @@ class MACPoolModule(BaseModule):
|
||||||
def build_entity(self):
|
def build_entity(self):
|
||||||
return otypes.MacPool(
|
return otypes.MacPool(
|
||||||
name=self._module.params['name'],
|
name=self._module.params['name'],
|
||||||
|
id=self._module.params['id'],
|
||||||
allow_duplicates=self._module.params['allow_duplicates'],
|
allow_duplicates=self._module.params['allow_duplicates'],
|
||||||
description=self._module.params['description'],
|
description=self._module.params['description'],
|
||||||
ranges=[
|
ranges=[
|
||||||
|
@ -103,7 +113,7 @@ class MACPoolModule(BaseModule):
|
||||||
to=mac_range.split(',')[1],
|
to=mac_range.split(',')[1],
|
||||||
)
|
)
|
||||||
for mac_range in self._module.params['ranges']
|
for mac_range in self._module.params['ranges']
|
||||||
],
|
] if self._module.params['ranges'] else None,
|
||||||
)
|
)
|
||||||
|
|
||||||
def _compare_ranges(self, entity):
|
def _compare_ranges(self, entity):
|
||||||
|
@ -120,7 +130,8 @@ class MACPoolModule(BaseModule):
|
||||||
return (
|
return (
|
||||||
self._compare_ranges(entity) and
|
self._compare_ranges(entity) and
|
||||||
equal(self._module.params['allow_duplicates'], entity.allow_duplicates) and
|
equal(self._module.params['allow_duplicates'], entity.allow_duplicates) and
|
||||||
equal(self._module.params['description'], entity.description)
|
equal(self._module.params['description'], entity.description) and
|
||||||
|
equal(self._module.params['name'], entity.name)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,6 +142,7 @@ def main():
|
||||||
default='present',
|
default='present',
|
||||||
),
|
),
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
|
id=dict(default=None),
|
||||||
allow_duplicates=dict(default=None, type='bool'),
|
allow_duplicates=dict(default=None, type='bool'),
|
||||||
description=dict(default=None),
|
description=dict(default=None),
|
||||||
ranges=dict(default=None, type='list'),
|
ranges=dict(default=None, type='list'),
|
||||||
|
|
|
@ -33,6 +33,10 @@ author: "Ondra Machacek (@machacekondra)"
|
||||||
description:
|
description:
|
||||||
- "Module to manage logical networks in oVirt/RHV"
|
- "Module to manage logical networks in oVirt/RHV"
|
||||||
options:
|
options:
|
||||||
|
id:
|
||||||
|
description:
|
||||||
|
- "ID of the network to manage."
|
||||||
|
version_added: "2.8"
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- "Name of the network to manage."
|
- "Name of the network to manage."
|
||||||
|
@ -93,6 +97,12 @@ EXAMPLES = '''
|
||||||
- ovirt_network:
|
- ovirt_network:
|
||||||
state: absent
|
state: absent
|
||||||
name: mynetwork
|
name: mynetwork
|
||||||
|
|
||||||
|
# Change Network Name
|
||||||
|
- ovirt_network:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new_network_name"
|
||||||
|
data_center: mydatacenter
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -134,6 +144,7 @@ class NetworksModule(BaseModule):
|
||||||
name=self._module.params['name'],
|
name=self._module.params['name'],
|
||||||
comment=self._module.params['comment'],
|
comment=self._module.params['comment'],
|
||||||
description=self._module.params['description'],
|
description=self._module.params['description'],
|
||||||
|
id=self._module.params['id'],
|
||||||
data_center=otypes.DataCenter(
|
data_center=otypes.DataCenter(
|
||||||
name=self._module.params['data_center'],
|
name=self._module.params['data_center'],
|
||||||
) if self._module.params['data_center'] else None,
|
) if self._module.params['data_center'] else None,
|
||||||
|
@ -168,6 +179,7 @@ class NetworksModule(BaseModule):
|
||||||
self._update_label_assignments(entity)
|
self._update_label_assignments(entity)
|
||||||
return (
|
return (
|
||||||
equal(self._module.params.get('comment'), entity.comment) and
|
equal(self._module.params.get('comment'), entity.comment) and
|
||||||
|
equal(self._module.params.get('name'), entity.name) and
|
||||||
equal(self._module.params.get('description'), entity.description) and
|
equal(self._module.params.get('description'), entity.description) and
|
||||||
equal(self._module.params.get('vlan_tag'), getattr(entity.vlan, 'id', None)) and
|
equal(self._module.params.get('vlan_tag'), getattr(entity.vlan, 'id', None)) and
|
||||||
equal(self._module.params.get('vm_network'), True if entity.usages else False) and
|
equal(self._module.params.get('vm_network'), True if entity.usages else False) and
|
||||||
|
@ -226,6 +238,7 @@ def main():
|
||||||
default='present',
|
default='present',
|
||||||
),
|
),
|
||||||
data_center=dict(required=True),
|
data_center=dict(required=True),
|
||||||
|
id=dict(default=None),
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
description=dict(default=None),
|
description=dict(default=None),
|
||||||
comment=dict(default=None),
|
comment=dict(default=None),
|
||||||
|
|
|
@ -18,6 +18,10 @@ author:
|
||||||
description:
|
description:
|
||||||
- Module to manage network interfaces of Virtual Machines in oVirt/RHV.
|
- Module to manage network interfaces of Virtual Machines in oVirt/RHV.
|
||||||
options:
|
options:
|
||||||
|
id:
|
||||||
|
description:
|
||||||
|
- "ID of the nic to manage."
|
||||||
|
version_added: "2.8"
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- Name of the network interface to manage.
|
- Name of the network interface to manage.
|
||||||
|
@ -94,6 +98,12 @@ EXAMPLES = '''
|
||||||
state: absent
|
state: absent
|
||||||
vm: myvm
|
vm: myvm
|
||||||
name: mynic
|
name: mynic
|
||||||
|
|
||||||
|
# Change NIC Name
|
||||||
|
- ovirt_nic:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new_nic_name"
|
||||||
|
vm: myvm
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -144,6 +154,7 @@ class EntityNicsModule(BaseModule):
|
||||||
|
|
||||||
def build_entity(self):
|
def build_entity(self):
|
||||||
return otypes.Nic(
|
return otypes.Nic(
|
||||||
|
id=self._module.params.get('id'),
|
||||||
name=self._module.params.get('name'),
|
name=self._module.params.get('name'),
|
||||||
interface=otypes.NicInterface(
|
interface=otypes.NicInterface(
|
||||||
self._module.params.get('interface')
|
self._module.params.get('interface')
|
||||||
|
@ -160,12 +171,14 @@ class EntityNicsModule(BaseModule):
|
||||||
if self._module.params.get('vm'):
|
if self._module.params.get('vm'):
|
||||||
return (
|
return (
|
||||||
equal(self._module.params.get('interface'), str(entity.interface)) and
|
equal(self._module.params.get('interface'), str(entity.interface)) and
|
||||||
|
equal(self._module.params.get('name'), str(entity.name)) and
|
||||||
equal(self._module.params.get('profile'), get_link_name(self._connection, entity.vnic_profile)) and
|
equal(self._module.params.get('profile'), get_link_name(self._connection, entity.vnic_profile)) and
|
||||||
equal(self._module.params.get('mac_address'), entity.mac.address)
|
equal(self._module.params.get('mac_address'), entity.mac.address)
|
||||||
)
|
)
|
||||||
elif self._module.params.get('template'):
|
elif self._module.params.get('template'):
|
||||||
return (
|
return (
|
||||||
equal(self._module.params.get('interface'), str(entity.interface)) and
|
equal(self._module.params.get('interface'), str(entity.interface)) and
|
||||||
|
equal(self._module.params.get('name'), str(entity.name)) and
|
||||||
equal(self._module.params.get('profile'), get_link_name(self._connection, entity.vnic_profile))
|
equal(self._module.params.get('profile'), get_link_name(self._connection, entity.vnic_profile))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -174,6 +187,7 @@ def main():
|
||||||
argument_spec = ovirt_full_argument_spec(
|
argument_spec = ovirt_full_argument_spec(
|
||||||
state=dict(type='str', default='present', choices=['absent', 'plugged', 'present', 'unplugged']),
|
state=dict(type='str', default='present', choices=['absent', 'plugged', 'present', 'unplugged']),
|
||||||
vm=dict(type='str'),
|
vm=dict(type='str'),
|
||||||
|
id=dict(default=None),
|
||||||
template=dict(type='str'),
|
template=dict(type='str'),
|
||||||
name=dict(type='str', required=True),
|
name=dict(type='str', required=True),
|
||||||
interface=dict(type='str'),
|
interface=dict(type='str'),
|
||||||
|
|
|
@ -18,6 +18,10 @@ author: "Ondra Machacek (@machacekondra)"
|
||||||
description:
|
description:
|
||||||
- "Module to manage datacenter quotas in oVirt/RHV"
|
- "Module to manage datacenter quotas in oVirt/RHV"
|
||||||
options:
|
options:
|
||||||
|
id:
|
||||||
|
description:
|
||||||
|
- "ID of the quota to manage."
|
||||||
|
version_added: "2.8"
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- "Name of the quota to manage."
|
- "Name of the quota to manage."
|
||||||
|
@ -106,6 +110,12 @@ EXAMPLES = '''
|
||||||
state: absent
|
state: absent
|
||||||
data_center: dcX
|
data_center: dcX
|
||||||
name: quota1
|
name: quota1
|
||||||
|
|
||||||
|
# Change Quota Name
|
||||||
|
- ovirt_quota:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new_quota_name"
|
||||||
|
data_center: dcX
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -146,6 +156,7 @@ class QuotasModule(BaseModule):
|
||||||
return otypes.Quota(
|
return otypes.Quota(
|
||||||
description=self._module.params['description'],
|
description=self._module.params['description'],
|
||||||
name=self._module.params['name'],
|
name=self._module.params['name'],
|
||||||
|
id=self._module.params['id'],
|
||||||
storage_hard_limit_pct=self._module.params.get('storage_grace'),
|
storage_hard_limit_pct=self._module.params.get('storage_grace'),
|
||||||
storage_soft_limit_pct=self._module.params.get('storage_threshold'),
|
storage_soft_limit_pct=self._module.params.get('storage_threshold'),
|
||||||
cluster_hard_limit_pct=self._module.params.get('cluster_grace'),
|
cluster_hard_limit_pct=self._module.params.get('cluster_grace'),
|
||||||
|
@ -202,6 +213,7 @@ class QuotasModule(BaseModule):
|
||||||
return (
|
return (
|
||||||
self.update_storage_limits(entity) and
|
self.update_storage_limits(entity) and
|
||||||
self.update_cluster_limits(entity) and
|
self.update_cluster_limits(entity) and
|
||||||
|
equal(self._module.params.get('name'), entity.name) and
|
||||||
equal(self._module.params.get('description'), entity.description) and
|
equal(self._module.params.get('description'), entity.description) and
|
||||||
equal(self._module.params.get('storage_grace'), entity.storage_hard_limit_pct) and
|
equal(self._module.params.get('storage_grace'), entity.storage_hard_limit_pct) and
|
||||||
equal(self._module.params.get('storage_threshold'), entity.storage_soft_limit_pct) and
|
equal(self._module.params.get('storage_threshold'), entity.storage_soft_limit_pct) and
|
||||||
|
@ -216,6 +228,7 @@ def main():
|
||||||
choices=['present', 'absent'],
|
choices=['present', 'absent'],
|
||||||
default='present',
|
default='present',
|
||||||
),
|
),
|
||||||
|
id=dict(default=None),
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
data_center=dict(required=True),
|
data_center=dict(required=True),
|
||||||
description=dict(default=None),
|
description=dict(default=None),
|
||||||
|
|
|
@ -34,6 +34,10 @@ description:
|
||||||
- "This module manage tags in oVirt/RHV. It can also manage assignments
|
- "This module manage tags in oVirt/RHV. It can also manage assignments
|
||||||
of those tags to entities."
|
of those tags to entities."
|
||||||
options:
|
options:
|
||||||
|
id:
|
||||||
|
description:
|
||||||
|
- "ID of the tag to manage."
|
||||||
|
version_added: "2.8"
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- "Name of the tag to manage."
|
- "Name of the tag to manage."
|
||||||
|
@ -93,6 +97,11 @@ EXAMPLES = '''
|
||||||
- ovirt_tag:
|
- ovirt_tag:
|
||||||
state: absent
|
state: absent
|
||||||
name: mytag
|
name: mytag
|
||||||
|
|
||||||
|
# Change cluster Name
|
||||||
|
- ovirt_tag:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new_tag_name"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -130,6 +139,7 @@ class TagsModule(BaseModule):
|
||||||
|
|
||||||
def build_entity(self):
|
def build_entity(self):
|
||||||
return otypes.Tag(
|
return otypes.Tag(
|
||||||
|
id=self._module.params['id'],
|
||||||
name=self._module.params['name'],
|
name=self._module.params['name'],
|
||||||
description=self._module.params['description'],
|
description=self._module.params['description'],
|
||||||
parent=otypes.Tag(
|
parent=otypes.Tag(
|
||||||
|
@ -195,6 +205,7 @@ class TagsModule(BaseModule):
|
||||||
self._update_tag_assignments(entity, 'hosts')
|
self._update_tag_assignments(entity, 'hosts')
|
||||||
return (
|
return (
|
||||||
equal(self._module.params.get('description'), entity.description) and
|
equal(self._module.params.get('description'), entity.description) and
|
||||||
|
equal(self._module.params.get('name'), entity.name) and
|
||||||
equal(self._module.params.get('parent'), self._get_parent(entity))
|
equal(self._module.params.get('parent'), self._get_parent(entity))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -205,6 +216,7 @@ def main():
|
||||||
choices=['present', 'absent', 'attached', 'detached'],
|
choices=['present', 'absent', 'attached', 'detached'],
|
||||||
default='present',
|
default='present',
|
||||||
),
|
),
|
||||||
|
id=dict(default=None),
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
description=dict(default=None),
|
description=dict(default=None),
|
||||||
parent=dict(default=None),
|
parent=dict(default=None),
|
||||||
|
|
|
@ -185,6 +185,11 @@ EXAMPLES = '''
|
||||||
state: absent
|
state: absent
|
||||||
name: mytemplate
|
name: mytemplate
|
||||||
|
|
||||||
|
# Change Template Name
|
||||||
|
- ovirt_template:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new_template_name"
|
||||||
|
|
||||||
# Register template
|
# Register template
|
||||||
- ovirt_template:
|
- ovirt_template:
|
||||||
state: registered
|
state: registered
|
||||||
|
@ -289,6 +294,7 @@ class TemplatesModule(BaseModule):
|
||||||
|
|
||||||
def build_entity(self):
|
def build_entity(self):
|
||||||
return otypes.Template(
|
return otypes.Template(
|
||||||
|
id=self._module.params['id'],
|
||||||
name=self._module.params['name'],
|
name=self._module.params['name'],
|
||||||
cluster=otypes.Cluster(
|
cluster=otypes.Cluster(
|
||||||
name=self._module.params['cluster']
|
name=self._module.params['cluster']
|
||||||
|
@ -326,6 +332,7 @@ class TemplatesModule(BaseModule):
|
||||||
equal(self._module.params.get('cluster'), get_link_name(self._connection, entity.cluster)) and
|
equal(self._module.params.get('cluster'), get_link_name(self._connection, entity.cluster)) and
|
||||||
equal(self._module.params.get('description'), entity.description) and
|
equal(self._module.params.get('description'), entity.description) and
|
||||||
equal(self.param('operating_system'), str(entity.os.type)) and
|
equal(self.param('operating_system'), str(entity.os.type)) and
|
||||||
|
equal(self.param('name'), str(entity.name)) and
|
||||||
equal(convert_to_bytes(self.param('memory_guaranteed')), entity.memory_policy.guaranteed) and
|
equal(convert_to_bytes(self.param('memory_guaranteed')), entity.memory_policy.guaranteed) and
|
||||||
equal(convert_to_bytes(self.param('memory_max')), entity.memory_policy.max) and
|
equal(convert_to_bytes(self.param('memory_max')), entity.memory_policy.max) and
|
||||||
equal(convert_to_bytes(self.param('memory')), entity.memory) and
|
equal(convert_to_bytes(self.param('memory')), entity.memory) and
|
||||||
|
|
|
@ -681,6 +681,11 @@ EXAMPLES = '''
|
||||||
nics:
|
nics:
|
||||||
- name: nic1
|
- name: nic1
|
||||||
|
|
||||||
|
# Change VM Name
|
||||||
|
- ovirt_vm:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new_vm_name"
|
||||||
|
|
||||||
- name: Run VM with cloud init
|
- name: Run VM with cloud init
|
||||||
ovirt_vm:
|
ovirt_vm:
|
||||||
name: rhel7
|
name: rhel7
|
||||||
|
@ -1184,6 +1189,7 @@ class VmsModule(BaseModule):
|
||||||
equal(self.param('cpu_threads'), entity.cpu.topology.threads) and
|
equal(self.param('cpu_threads'), entity.cpu.topology.threads) and
|
||||||
equal(self.param('cpu_mode'), str(cpu_mode) if cpu_mode else None) and
|
equal(self.param('cpu_mode'), str(cpu_mode) if cpu_mode else None) and
|
||||||
equal(self.param('type'), str(entity.type)) and
|
equal(self.param('type'), str(entity.type)) and
|
||||||
|
equal(self.param('name'), str(entity.name)) and
|
||||||
equal(self.param('operating_system'), str(entity.os.type)) and
|
equal(self.param('operating_system'), str(entity.os.type)) and
|
||||||
equal(self.param('boot_menu'), entity.bios.boot_menu.enabled) and
|
equal(self.param('boot_menu'), entity.bios.boot_menu.enabled) and
|
||||||
equal(self.param('soundcard_enabled'), entity.soundcard_enabled) and
|
equal(self.param('soundcard_enabled'), entity.soundcard_enabled) and
|
||||||
|
|
|
@ -33,6 +33,10 @@ author: "Ondra Machacek (@machacekondra)"
|
||||||
description:
|
description:
|
||||||
- "Module to manage VM pools in oVirt/RHV."
|
- "Module to manage VM pools in oVirt/RHV."
|
||||||
options:
|
options:
|
||||||
|
id:
|
||||||
|
description:
|
||||||
|
- "ID of the vmpool to manage."
|
||||||
|
version_added: "2.8"
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- "Name of the VM pool to manage."
|
- "Name of the VM pool to manage."
|
||||||
|
@ -97,6 +101,11 @@ EXAMPLES = '''
|
||||||
- ovirt_vmpool:
|
- ovirt_vmpool:
|
||||||
state: absent
|
state: absent
|
||||||
name: myvmpool
|
name: myvmpool
|
||||||
|
|
||||||
|
# Change Pool Name
|
||||||
|
- ovirt_vmpool:
|
||||||
|
id: 00000000-0000-0000-0000-000000000000
|
||||||
|
name: "new_pool_name"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
@ -136,6 +145,7 @@ class VmPoolsModule(BaseModule):
|
||||||
|
|
||||||
def build_entity(self):
|
def build_entity(self):
|
||||||
return otypes.VmPool(
|
return otypes.VmPool(
|
||||||
|
id=self._module.params['id'],
|
||||||
name=self._module.params['name'],
|
name=self._module.params['name'],
|
||||||
description=self._module.params['description'],
|
description=self._module.params['description'],
|
||||||
comment=self._module.params['comment'],
|
comment=self._module.params['comment'],
|
||||||
|
@ -155,6 +165,7 @@ class VmPoolsModule(BaseModule):
|
||||||
|
|
||||||
def update_check(self, entity):
|
def update_check(self, entity):
|
||||||
return (
|
return (
|
||||||
|
equal(self._module.params.get('name'), entity.name) and
|
||||||
equal(self._module.params.get('cluster'), get_link_name(self._connection, entity.cluster)) and
|
equal(self._module.params.get('cluster'), get_link_name(self._connection, entity.cluster)) and
|
||||||
equal(self._module.params.get('description'), entity.description) and
|
equal(self._module.params.get('description'), entity.description) and
|
||||||
equal(self._module.params.get('comment'), entity.comment) and
|
equal(self._module.params.get('comment'), entity.comment) and
|
||||||
|
@ -166,6 +177,7 @@ class VmPoolsModule(BaseModule):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
argument_spec = ovirt_full_argument_spec(
|
argument_spec = ovirt_full_argument_spec(
|
||||||
|
id=dict(default=None),
|
||||||
state=dict(
|
state=dict(
|
||||||
choices=['present', 'absent'],
|
choices=['present', 'absent'],
|
||||||
default='present',
|
default='present',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue