Cloudstack: fix support for some VPC service capabilities (#45727)

* Fix support for VPC capabilities such as redundant routers or region level VPC

* Add integration test cases for "region level VPC" and "distributed router" capabilities
This commit is contained in:
David Passante 2018-09-17 16:08:16 +02:00 committed by René Moser
parent 78e9f452a5
commit 05328ebf21
2 changed files with 66 additions and 2 deletions

View file

@ -65,8 +65,36 @@ EXAMPLES = '''
state: enabled
supported_services: [ Dns, Dhcp ]
service_providers:
- {service: 'dns', provider: 'virtualrouter'}
- {service: 'dhcp', provider: 'virtualrouter'}
- {service: 'dns', provider: 'VpcVirtualRouter'}
- {service: 'dhcp', provider: 'VpcVirtualRouter'}
# Create a vpc offering with redundant router
- local_action:
module: cs_vpc_offering
name: "my_vpc_offering"
display_text: "vpc offering description"
supported_services: [ Dns, Dhcp, SourceNat ]
service_providers:
- {service: 'dns', provider: 'VpcVirtualRouter'}
- {service: 'dhcp', provider: 'VpcVirtualRouter'}
- {service: 'SourceNat', provider: 'VpcVirtualRouter'}
service_capabilities:
- {service: 'SourceNat', capabilitytype: 'RedundantRouter', capabilityvalue: true}
# Create a region level vpc offering with distributed router
- local_action:
module: cs_vpc_offering
name: "my_vpc_offering"
display_text: "vpc offering description"
state: present
supported_services: [ Dns, Dhcp, SourceNat ]
service_providers:
- {service: 'dns', provider: 'VpcVirtualRouter'}
- {service: 'dhcp', provider: 'VpcVirtualRouter'}
- {service: 'SourceNat', provider: 'VpcVirtualRouter'}
service_capabilities:
- {service: 'Connectivity', capabilitytype: 'DistributedRouter', capabilityvalue: true}
- {service: 'Connectivity', capabilitytype: 'RegionLevelVPC', capabilityvalue: true}
# Remove a vpc offering
- local_action:
@ -189,6 +217,7 @@ class AnsibleCloudStackVPCOffering(AnsibleCloudStack):
'supportedservices': self.module.params.get('supported_services'),
'serviceproviderlist': self.module.params.get('service_providers'),
'serviceofferingid': self.get_service_offering_id(),
'servicecapabilitylist': self.module.params.get('service_capabilities'),
}
required_params = [

View file

@ -380,6 +380,30 @@
- vpcoffer.state == "Enabled"
- vpcoffer.display_text == "vpc offering description"
- name: test create enabled region level vpc offer with distrubuted router
cs_vpc_offering:
name: "{{ cs_resource_prefix }}_vpc_drl"
display_text: "vpc offering description"
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, StaticNat, Vpn, Lb ]
service_providers:
- { service: 'dns', provider: 'virtualrouter' }
- { service: 'dhcp', provider: 'virtualrouter' }
state: enabled
service_capabilities:
- {service: 'Connectivity', capabilitytype: 'DistributedRouter', capabilityvalue: true}
- {service: 'Connectivity', capabilitytype: 'RegionLevelVPC', capabilityvalue: true}
register: vpcoffer
- name: verify results of create enabled region level vpc offer with distrubuted router
assert:
that:
- vpcoffer is successful
- vpcoffer is changed
- vpcoffer.name == "{{ cs_resource_prefix }}_vpc_drl"
- vpcoffer.state == "Enabled"
- vpcoffer.display_text == "vpc offering description"
- vpcoffer.distributed == true
- vpcoffer.region_level == true
- name: remove vpc offer
cs_vpc_offering:
name: "{{ cs_resource_prefix }}_vpc"
@ -390,3 +414,14 @@
that:
- vpcoffer is successful
- vpcoffer is changed
- name: remove region level vpc offer with distrubuted router
cs_vpc_offering:
name: "{{ cs_resource_prefix }}_vpc_drl"
state: absent
register: vpcoffer
- name: verify results of remove region level vpc offer with distrubuted router
assert:
that:
- vpcoffer is successful
- vpcoffer is changed