mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-01 05:49:09 -07:00
Ovirt vms improve (#20882)
* cloud: ovirt: add function to get id by name * cloud: ovirt: add instance type parameter * cloud: ovirt: use param method instead of module.params * cloud: ovirt: use 'and' at begging of next line * cloud: ovirt: add description parameter to vms module * cloud: ovirt: add comment parameter to vms module * cloud: ovirt: add timezone parameter to vms module * cloud: ovirt: add serial_policy parameter to vms module
This commit is contained in:
parent
ee7f1cde0e
commit
4269b12c9d
3 changed files with 143 additions and 48 deletions
|
@ -51,6 +51,16 @@ options:
|
|||
- "Search term which is accepted by oVirt search backend."
|
||||
- "For example to search VM X from cluster Y use following pattern:
|
||||
name=X and cluster=Y"
|
||||
all_content:
|
||||
description:
|
||||
- "If I(true) all the attributes of the virtual machines should be
|
||||
included in the response."
|
||||
case_sensitive:
|
||||
description:
|
||||
- "If I(true) performed search will take case into account."
|
||||
max:
|
||||
description:
|
||||
- "The maximum number of results to return."
|
||||
extends_documentation_fragment: ovirt_facts
|
||||
'''
|
||||
|
||||
|
@ -78,6 +88,9 @@ ovirt_vms:
|
|||
def main():
|
||||
argument_spec = ovirt_facts_full_argument_spec(
|
||||
pattern=dict(default='', required=False),
|
||||
all_content=dict(default=False, type='bool'),
|
||||
case_sensitive=dict(default=True, type='bool'),
|
||||
max=dict(default=None, type='int'),
|
||||
)
|
||||
module = AnsibleModule(argument_spec)
|
||||
check_sdk(module)
|
||||
|
@ -85,7 +98,12 @@ def main():
|
|||
try:
|
||||
connection = create_connection(module.params.pop('auth'))
|
||||
vms_service = connection.system_service().vms_service()
|
||||
vms = vms_service.list(search=module.params['pattern'])
|
||||
vms = vms_service.list(
|
||||
search=module.params['pattern'],
|
||||
all_content=module.params['all_content'],
|
||||
case_sensitive=module.params['case_sensitive'],
|
||||
max=module.params['max'],
|
||||
)
|
||||
module.exit_json(
|
||||
changed=False,
|
||||
ansible_facts=dict(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue