mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-02 15:21:25 -07:00
cs_service_offering: Implement customizable compute offers (#54597)
This commit is contained in:
parent
2ef0946370
commit
b0d0a3a2f8
2 changed files with 64 additions and 1 deletions
|
@ -162,6 +162,11 @@ options:
|
|||
type: list
|
||||
aliases:
|
||||
- storage_tag
|
||||
is_customized:
|
||||
description:
|
||||
- Whether the offering is customizable or not.
|
||||
type: bool
|
||||
version_added: '2.8'
|
||||
extends_documentation_fragment: cloudstack
|
||||
'''
|
||||
|
||||
|
@ -203,6 +208,16 @@ EXAMPLES = '''
|
|||
storage_tags: eco
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Create or update a custom compute service offering
|
||||
cs_service_offering:
|
||||
name: custom
|
||||
display_text: custom compute offer
|
||||
is_customized: yes
|
||||
storage_type: shared
|
||||
host_tags: eco
|
||||
storage_tags: eco
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Remove a compute service offering
|
||||
cs_service_offering:
|
||||
name: Tiny
|
||||
|
@ -362,6 +377,12 @@ network_rate:
|
|||
returned: success
|
||||
type: int
|
||||
sample: 1000
|
||||
is_customized:
|
||||
description: Whether the offering is customizable or not
|
||||
returned: success
|
||||
type: bool
|
||||
sample: false
|
||||
version_added: '2.8'
|
||||
'''
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
@ -470,7 +491,8 @@ class AnsibleCloudStackServiceOffering(AnsibleCloudStack):
|
|||
'storagetype': self.module.params.get('storage_type'),
|
||||
'systemvmtype': system_vm_type,
|
||||
'tags': self.module.params.get('storage_tags'),
|
||||
'limitcpuuse': self.module.params.get('limit_cpu_usage')
|
||||
'limitcpuuse': self.module.params.get('limit_cpu_usage'),
|
||||
'customized': self.module.params.get('is_customized')
|
||||
}
|
||||
if not self.module.check_mode:
|
||||
res = self.query_api('createServiceOffering', **args)
|
||||
|
@ -536,6 +558,7 @@ def main():
|
|||
system_vm_type=dict(choices=['domainrouter', 'consoleproxy', 'secondarystoragevm']),
|
||||
storage_tags=dict(type='list', aliases=['storage_tag']),
|
||||
state=dict(choices=['present', 'absent'], default='present'),
|
||||
is_customized=dict(type='bool'),
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue