cloudstack: rename new module to cs_service_offering (#34555)

* cloudstack: rename cs_serviceoffer to cs_service_offering

* adjust references to old name

* cs_service_offering: fix limitcpuuse not handled

* minor docs fix

* update changelog
This commit is contained in:
René Moser 2018-01-07 17:21:56 +01:00 committed by GitHub
parent d2ccc13857
commit 439e64256f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 37 deletions

View file

@ -100,7 +100,7 @@ Ansible Changes By Release
- cloudscale - cloudscale
* cloudscale_floating_ip * cloudscale_floating_ip
- cloudstack - cloudstack
* cs_serviceoffer * cs_service_offering
- digital_ocean - digital_ocean
* digital_ocean_certificate * digital_ocean_certificate
* digital_ocean_sshkey_facts * digital_ocean_sshkey_facts

View file

@ -13,7 +13,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: cs_serviceoffer module: cs_service_offering
description: description:
- Create and delete service offerings for guest and system VMs. - Create and delete service offerings for guest and system VMs.
- Update display_text of existing service offering. - Update display_text of existing service offering.
@ -36,7 +36,7 @@ options:
limit_cpu_usage: limit_cpu_usage:
description: description:
- Restrict the CPU usage to committed service offering. - Restrict the CPU usage to committed service offering.
type: bool choices: [ yes, no ]
deployment_planner: deployment_planner:
description: description:
- The deployment planner heuristics used to deploy a VM of this offering. - The deployment planner heuristics used to deploy a VM of this offering.
@ -77,12 +77,14 @@ options:
is_system: is_system:
description: description:
- Whether it is a system VM offering or not. - Whether it is a system VM offering or not.
default: false choices: [ yes, no ]
default: no
is_volatile: is_volatile:
description: description:
- Whether the virtual machine needs to be volatile or not. - Whether the virtual machine needs to be volatile or not.
- Every reboot of VM the root disk is detached then destroyed and a fresh root disk is created and attached to VM. - Every reboot of VM the root disk is detached then destroyed and a fresh root disk is created and attached to VM.
default: false choices: [ yes, no ]
default: no
memory: memory:
description: description:
- The total memory of the service offering in MB. - The total memory of the service offering in MB.
@ -97,7 +99,8 @@ options:
offer_ha: offer_ha:
description: description:
- Whether HA is set for the service offering. - Whether HA is set for the service offering.
default: false choices: [ yes, no ]
default: no
provisioning_type: provisioning_type:
description: description:
- Provisioning type used to create volumes. - Provisioning type used to create volumes.
@ -140,7 +143,7 @@ extends_documentation_fragment: cloudstack
EXAMPLES = ''' EXAMPLES = '''
- name: Create a non-volatile compute service offering with local storage - name: Create a non-volatile compute service offering with local storage
local_action: local_action:
module: cs_serviceoffer module: cs_service_offering
name: Micro name: Micro
display_text: Micro 512mb 1cpu display_text: Micro 512mb 1cpu
cpu_number: 1 cpu_number: 1
@ -151,7 +154,7 @@ EXAMPLES = '''
- name: Create a volatile compute service offering with shared storage - name: Create a volatile compute service offering with shared storage
local_action: local_action:
module: cs_serviceoffer module: cs_service_offering
name: Tiny name: Tiny
display_text: Tiny 1gb 1cpu display_text: Tiny 1gb 1cpu
cpu_number: 1 cpu_number: 1
@ -164,29 +167,29 @@ EXAMPLES = '''
- name: Create or update a volatile compute service offering with shared storage - name: Create or update a volatile compute service offering with shared storage
local_action: local_action:
module: cs_serviceoffer module: cs_service_offering
name: Tiny name: Tiny
display_text: Tiny 1gb 1cpu display_text: Tiny 1gb 1cpu
cpu_number: 1 cpu_number: 1
cpu_speed: 2198 cpu_speed: 2198
memory: 1024 memory: 1024
storage_type: shared storage_type: shared
is_volatile: true is_volatile: yes
host_tags: eco host_tags: eco
storage_tags: eco storage_tags: eco
- name: Remove a compute service offering - name: Remove a compute service offering
local_action: local_action:
module: cs_serviceoffer module: cs_service_offering
name: Tiny name: Tiny
state: absent state: absent
- name: Create or update a system offering for the console proxy - name: Create or update a system offering for the console proxy
local_action: local_action:
module: cs_serviceoffer module: cs_service_offering
name: System Offering for Console Proxy 2GB name: System Offering for Console Proxy 2GB
display_text: System Offering for Console Proxy 2GB RAM display_text: System Offering for Console Proxy 2GB RAM
is_system: true is_system: yes
system_vm_type: consoleproxy system_vm_type: consoleproxy
cpu_number: 1 cpu_number: 1
cpu_speed: 2198 cpu_speed: 2198
@ -196,9 +199,9 @@ EXAMPLES = '''
- name: Remove a system offering - name: Remove a system offering
local_action: local_action:
module: cs_serviceoffer module: cs_service_offering
name: "System Offering for Console Proxy 2GB" name: System Offering for Console Proxy 2GB
is_system: true is_system: yes
state: absent state: absent
''' '''
@ -328,8 +331,7 @@ service_offering_details:
description: Additioanl service offering details description: Additioanl service offering details
returned: success returned: success
type: dict type: dict
sample: "{'vgpuType': 'GRID K180Q','pciDevice':'Group of NVIDIA Corporation GK107GL sample: "{'vgpuType': 'GRID K180Q','pciDevice':'Group of NVIDIA Corporation GK107GL [GRID K1] GPUs'}"
[GRID K1] GPUs'}"
network_rate: network_rate:
description: Data transfer rate in megabits per second allowed description: Data transfer rate in megabits per second allowed
returned: success returned: success
@ -443,7 +445,7 @@ class AnsibleCloudStackServiceOffering(AnsibleCloudStack):
'storagetype': self.module.params.get('storage_type'), 'storagetype': self.module.params.get('storage_type'),
'systemvmtype': system_vm_type, 'systemvmtype': system_vm_type,
'tags': self.module.params.get('storage_tags'), 'tags': self.module.params.get('storage_tags'),
'limit_cpu_use': self.module.params.get('limit_cpu_usage') 'limitcpuuse': self.module.params.get('limit_cpu_usage')
} }
if not self.module.check_mode: if not self.module.check_mode:
res = self.query_api('createServiceOffering', **args) res = self.query_api('createServiceOffering', **args)

View file

@ -1,6 +1,6 @@
--- ---
- name: setup service offering - name: setup service offering
cs_serviceoffer: cs_service_offering:
name: Micro name: Micro
state: absent state: absent
register: so register: so
@ -10,7 +10,7 @@
- so is successful - so is successful
- name: create service offering in check mode - name: create service offering in check mode
cs_serviceoffer: cs_service_offering:
name: Micro name: Micro
display_text: Micro 512mb 1cpu display_text: Micro 512mb 1cpu
cpu_number: 1 cpu_number: 1
@ -29,7 +29,7 @@
- so is changed - so is changed
- name: create service offering - name: create service offering
cs_serviceoffer: cs_service_offering:
name: Micro name: Micro
display_text: Micro 512mb 1cpu display_text: Micro 512mb 1cpu
cpu_number: 1 cpu_number: 1
@ -55,7 +55,7 @@
- so.storage_type == "local" - so.storage_type == "local"
- name: create service offering idempotence - name: create service offering idempotence
cs_serviceoffer: cs_service_offering:
name: Micro name: Micro
display_text: Micro 512mb 1cpu display_text: Micro 512mb 1cpu
cpu_number: 1 cpu_number: 1
@ -81,7 +81,7 @@
- so.storage_type == "local" - so.storage_type == "local"
- name: update service offering in check mode - name: update service offering in check mode
cs_serviceoffer: cs_service_offering:
name: Micro name: Micro
display_text: Micro RAM 512MB 1vCPU display_text: Micro RAM 512MB 1vCPU
register: so register: so
@ -100,7 +100,7 @@
- so.storage_type == "local" - so.storage_type == "local"
- name: update service offering - name: update service offering
cs_serviceoffer: cs_service_offering:
name: Micro name: Micro
display_text: Micro RAM 512MB 1vCPU display_text: Micro RAM 512MB 1vCPU
register: so register: so
@ -118,7 +118,7 @@
- so.storage_type == "local" - so.storage_type == "local"
- name: update service offering idempotence - name: update service offering idempotence
cs_serviceoffer: cs_service_offering:
name: Micro name: Micro
display_text: Micro RAM 512MB 1vCPU display_text: Micro RAM 512MB 1vCPU
register: so register: so
@ -136,7 +136,7 @@
- so.storage_type == "local" - so.storage_type == "local"
- name: remove service offering in check mode - name: remove service offering in check mode
cs_serviceoffer: cs_service_offering:
name: Micro name: Micro
state: absent state: absent
check_mode: true check_mode: true
@ -155,7 +155,7 @@
- so.storage_type == "local" - so.storage_type == "local"
- name: remove service offering - name: remove service offering
cs_serviceoffer: cs_service_offering:
name: Micro name: Micro
state: absent state: absent
register: so register: so
@ -173,7 +173,7 @@
- so.storage_type == "local" - so.storage_type == "local"
- name: remove service offering idempotence - name: remove service offering idempotence
cs_serviceoffer: cs_service_offering:
name: Micro name: Micro
state: absent state: absent
register: so register: so

View file

@ -1,6 +1,6 @@
--- ---
- name: setup system offering - name: setup system offering
cs_serviceoffer: cs_service_offering:
name: System Offering for Ansible name: System Offering for Ansible
is_system: true is_system: true
state: absent state: absent
@ -11,7 +11,7 @@
- so is successful - so is successful
- name: fail missing storage type and is_system - name: fail missing storage type and is_system
cs_serviceoffer: cs_service_offering:
name: System Offering for Ansible name: System Offering for Ansible
cpu_number: 1 cpu_number: 1
cpu_speed: 500 cpu_speed: 500
@ -31,7 +31,7 @@
- so.msg.startswith('missing required arguments:') - so.msg.startswith('missing required arguments:')
- name: create system service offering in check mode - name: create system service offering in check mode
cs_serviceoffer: cs_service_offering:
name: System Offering for Ansible name: System Offering for Ansible
cpu_number: 1 cpu_number: 1
cpu_speed: 500 cpu_speed: 500
@ -51,7 +51,7 @@
- so is changed - so is changed
- name: create system service offering - name: create system service offering
cs_serviceoffer: cs_service_offering:
name: System Offering for Ansible name: System Offering for Ansible
cpu_number: 1 cpu_number: 1
cpu_speed: 500 cpu_speed: 500
@ -82,7 +82,7 @@
- so.is_system == true - so.is_system == true
- name: create system service offering idempotence - name: create system service offering idempotence
cs_serviceoffer: cs_service_offering:
name: System Offering for Ansible name: System Offering for Ansible
cpu_number: 1 cpu_number: 1
cpu_speed: 500 cpu_speed: 500
@ -113,7 +113,7 @@
- so.is_system == true - so.is_system == true
- name: remove system service offering in check mode - name: remove system service offering in check mode
cs_serviceoffer: cs_service_offering:
name: System Offering for Ansible name: System Offering for Ansible
is_system: true is_system: true
state: absent state: absent
@ -127,7 +127,7 @@
- so.is_system == true - so.is_system == true
- name: remove system service offering - name: remove system service offering
cs_serviceoffer: cs_service_offering:
name: System Offering for Ansible name: System Offering for Ansible
is_system: true is_system: true
state: absent state: absent
@ -140,7 +140,7 @@
- so.is_system == true - so.is_system == true
- name: remove system service offering idempotence - name: remove system service offering idempotence
cs_serviceoffer: cs_service_offering:
name: System Offering for Ansible name: System Offering for Ansible
is_system: true is_system: true
state: absent state: absent