mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
466 lines
16 KiB
YAML
466 lines
16 KiB
YAML
---
|
|
- name: setup
|
|
cs_network_offering: name={{ cs_resource_prefix }}_name state=absent
|
|
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
|
|
- 'netoffer.msg == "missing required arguments: display_text, guest_ip_type, supported_services, service_provider_list"'
|
|
|
|
- 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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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"
|
|
|
|
- name: test enabling network offer in check_mode
|
|
cs_network_offering:
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
display_text: "network offering description"
|
|
guest_ip_type: Isolated
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
state: enabled
|
|
register: netoffer
|
|
check_mode: yes
|
|
- name: verify results of enabling 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 enabling network offer
|
|
cs_network_offering:
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
display_text: "network offering description"
|
|
guest_ip_type: Isolated
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
state: enabled
|
|
register: netoffer
|
|
- name: verify results of enabling 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 enabling network offer idempotence
|
|
cs_network_offering:
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
display_text: "network offering description"
|
|
guest_ip_type: Isolated
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
state: enabled
|
|
register: netoffer
|
|
- name: verify results of enabling network 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: test disabling network offer in check_mode
|
|
cs_network_offering:
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
display_text: "network offering description"
|
|
guest_ip_type: Isolated
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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"
|
|
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"
|
|
|
|
- name: test update offer with minimal params
|
|
cs_network_offering:
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
display_text: "network offering description update"
|
|
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"
|
|
|
|
- name: test update offer with minimal params idempotency
|
|
cs_network_offering:
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
display_text: "network offering description update"
|
|
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"
|
|
|
|
- name: test remove network offer in check_mode
|
|
cs_network_offering:
|
|
name: "{{ cs_resource_prefix }}_name"
|
|
display_text: "network offering description renamed"
|
|
guest_ip_type: Isolated
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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"
|
|
display_text: "network offering description renamed"
|
|
guest_ip_type: Isolated
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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"
|
|
display_text: "network offering description renamed"
|
|
guest_ip_type: Isolated
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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"
|
|
display_text: "network offering description renamed"
|
|
guest_ip_type: Isolated
|
|
supported_services: Dns,PortForwarding,Dhcp,SourceNat,UserData,Firewall,StaticNat,Vpn,Lb
|
|
service_provider_list:
|
|
- {service: 'dns', provider: 'virtualrouter'}
|
|
- {service: 'dhcp', provider: 'virtualrouter'}
|
|
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"
|