2018-01-05 19:06:49 +00:00
|
|
|
---
|
|
|
|
- name: setup
|
2018-01-07 16:30:52 +00:00
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
state: absent
|
2018-01-05 19:06:49 +00:00
|
|
|
register: netoffer
|
|
|
|
- name: verify setup
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
|
|
|
|
- name: test fail if missing name
|
|
|
|
action: cs_network_offering
|
|
|
|
register: netoffer
|
|
|
|
ignore_errors: true
|
|
|
|
- name: verify results of fail if missing name
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is failed
|
|
|
|
- 'netoffer.msg == "missing required arguments: name"'
|
|
|
|
|
|
|
|
- name: test fail if missing params
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
register: netoffer
|
|
|
|
ignore_errors: true
|
|
|
|
- name: verify results of fail if missing params
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is failed
|
2018-01-07 16:30:52 +00:00
|
|
|
- 'netoffer.msg == "missing required arguments: display_text, guest_ip_type, supported_services, service_providers"'
|
2018-01-05 19:06:49 +00:00
|
|
|
|
|
|
|
- name: test create network offer in check mode
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
max_connections: 300
|
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
register: netoffer
|
|
|
|
check_mode: yes
|
|
|
|
- name: verify results of network offer in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
|
|
|
|
- name: test create network offer
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
max_connections: 300
|
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
register: netoffer
|
|
|
|
- name: verify results of network offer
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
|
|
|
- name: test create network offer idempotence
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
max_connections: 300
|
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
register: netoffer
|
|
|
|
- name: verify results of create network offer idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is not changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
2018-01-07 16:30:52 +00:00
|
|
|
- name: test enabling existing network offer in check_mode
|
2018-01-05 19:06:49 +00:00
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
state: enabled
|
|
|
|
register: netoffer
|
|
|
|
check_mode: yes
|
2018-01-07 16:30:52 +00:00
|
|
|
- name: verify results of enabling existing network offer in check_mode
|
2018-01-05 19:06:49 +00:00
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
2018-01-07 16:30:52 +00:00
|
|
|
- name: test enabling existing network offer
|
2018-01-05 19:06:49 +00:00
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
state: enabled
|
|
|
|
register: netoffer
|
2018-01-07 16:30:52 +00:00
|
|
|
- name: verify results of enabling existing network offer
|
2018-01-05 19:06:49 +00:00
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Enabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
2018-01-07 16:30:52 +00:00
|
|
|
- name: test enabling existing network offer idempotence
|
2018-01-05 19:06:49 +00:00
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
state: enabled
|
|
|
|
register: netoffer
|
2018-01-07 16:30:52 +00:00
|
|
|
- name: verify results of enabling existing network idempotence
|
2018-01-05 19:06:49 +00:00
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is not changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Enabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
|
|
|
- name: test disabling network offer in check_mode
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
state: disabled
|
|
|
|
register: netoffer
|
|
|
|
check_mode: yes
|
|
|
|
- name: verify results of disabling network offer in check_mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Enabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
|
|
|
- name: test disabling network offer
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
state: disabled
|
|
|
|
register: netoffer
|
|
|
|
- name: verify results of disabling network offer
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
|
|
|
- name: test disabling network offer idempotence
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
state: disabled
|
|
|
|
register: netoffer
|
|
|
|
- name: verify results of disabling network idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is not changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
|
|
|
- name: test rename network offer in check_mode
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description renamed"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
state: disabled
|
|
|
|
register: netoffer
|
|
|
|
check_mode: yes
|
|
|
|
- name: verify results of rename network offer in check_mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
|
|
|
- name: test rename network offer
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description renamed"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
state: disabled
|
|
|
|
register: netoffer
|
|
|
|
- name: verify results of rename network offer
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description renamed"
|
|
|
|
|
|
|
|
- name: test rename network offer idempotence
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description renamed"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
state: disabled
|
|
|
|
register: netoffer
|
|
|
|
- name: verify results of rename network offer idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is not changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description renamed"
|
|
|
|
|
|
|
|
- name: test update offer with minimal params in check_mode
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description update"
|
2018-01-07 16:30:52 +00:00
|
|
|
max_connections: 400
|
2018-01-05 19:06:49 +00:00
|
|
|
register: netoffer
|
|
|
|
check_mode: yes
|
|
|
|
- name: verify results of update offer with minimal params in check_mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description renamed"
|
2018-01-07 16:30:52 +00:00
|
|
|
- netoffer.max_connections == 300
|
2018-01-05 19:06:49 +00:00
|
|
|
|
|
|
|
- name: test update offer with minimal params
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description update"
|
2018-01-07 16:30:52 +00:00
|
|
|
max_connections: 400
|
2018-01-05 19:06:49 +00:00
|
|
|
register: netoffer
|
|
|
|
- name: verify results of update offer with minimal params
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description update"
|
2018-01-07 16:30:52 +00:00
|
|
|
- netoffer.max_connections == 400
|
2018-01-05 19:06:49 +00:00
|
|
|
|
|
|
|
- name: test update offer with minimal params idempotency
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description update"
|
2018-01-07 16:30:52 +00:00
|
|
|
max_connections: 400
|
2018-01-05 19:06:49 +00:00
|
|
|
register: netoffer
|
|
|
|
- name: verify results of update offer with minimal params idempotency
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is not changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description update"
|
2018-01-07 16:30:52 +00:00
|
|
|
- netoffer.max_connections == 400
|
2018-01-05 19:06:49 +00:00
|
|
|
|
|
|
|
- name: test remove network offer in check_mode
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
state: absent
|
|
|
|
register: netoffer
|
|
|
|
check_mode: yes
|
|
|
|
- name: verify results of rename network offer in check_mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description update"
|
|
|
|
|
|
|
|
- name: test remove network offer
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
state: absent
|
|
|
|
register: netoffer
|
|
|
|
- name: verify results of rename network offer
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Disabled"
|
|
|
|
- netoffer.display_text == "network offering description update"
|
|
|
|
|
|
|
|
- name: test remove network offer idempotence
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
state: absent
|
|
|
|
register: netoffer
|
|
|
|
- name: verify results of rename network offer idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is not changed
|
|
|
|
|
|
|
|
- name: test create enabled network offer in check mode
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
state: enabled
|
|
|
|
register: netoffer
|
|
|
|
check_mode: yes
|
|
|
|
- name: verify results of create enabled network offer in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
|
|
|
|
- name: test create enabled network offer
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
state: enabled
|
|
|
|
register: netoffer
|
|
|
|
- name: verify results of create enabled network offer
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Enabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
|
|
|
- name: test create enabled network offer idempotence
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
display_text: "network offering description"
|
|
|
|
guest_ip_type: Isolated
|
2018-01-07 16:30:52 +00:00
|
|
|
supported_services: [ Dns, PortForwarding, Dhcp, SourceNat, UserData, Firewall, StaticNat, Vpn, Lb ]
|
|
|
|
service_providers:
|
|
|
|
- { service: 'dns', provider: 'virtualrouter' }
|
|
|
|
- { service: 'dhcp', provider: 'virtualrouter' }
|
2018-01-05 19:06:49 +00:00
|
|
|
state: enabled
|
|
|
|
register: netoffer
|
|
|
|
- name: verify results of create enabled network offer idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is not changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Enabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|
|
|
|
|
|
|
|
- name: remove network offer
|
|
|
|
cs_network_offering:
|
|
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
|
|
state: absent
|
|
|
|
register: netoffer
|
|
|
|
- name: verify results of remove network offer
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- netoffer is successful
|
|
|
|
- netoffer is changed
|
|
|
|
- netoffer.name == "{{ cs_resource_prefix }}_name"
|
|
|
|
- netoffer.guest_ip_type == "Isolated"
|
|
|
|
- netoffer.state == "Enabled"
|
|
|
|
- netoffer.display_text == "network offering description"
|