2016-02-02 19:20:53 +00:00
|
|
|
---
|
|
|
|
- name: setup zone is present
|
|
|
|
cs_zone:
|
|
|
|
name: "{{ cs_resource_prefix }}-zone"
|
|
|
|
dns1: 8.8.8.8
|
|
|
|
dns2: 8.8.4.4
|
|
|
|
network_type: basic
|
|
|
|
register: zone
|
|
|
|
- name: verify setup zone is present
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- zone is successful
|
2016-02-02 19:20:53 +00:00
|
|
|
|
2017-05-09 03:32:11 +00:00
|
|
|
- name: setup pod is absent
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
state: absent
|
|
|
|
register: pod
|
|
|
|
- name: verify setup pod is absent
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is successful
|
2017-05-09 03:32:11 +00:00
|
|
|
|
2016-02-02 19:20:53 +00:00
|
|
|
- name: test fail if missing name
|
|
|
|
cs_pod:
|
|
|
|
register: pod
|
|
|
|
ignore_errors: true
|
|
|
|
- name: verify results of fail if missing name
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is failed
|
2016-02-02 19:20:53 +00:00
|
|
|
- "pod.msg == 'missing required arguments: name'"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
|
|
|
|
- name: test create pod in check mode
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
start_ip: 10.100.10.101
|
|
|
|
gateway: 10.100.10.1
|
|
|
|
netmask: 255.255.255.0
|
|
|
|
register: pod_origin
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test create pod in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod_origin is changed
|
2017-05-26 10:19:47 +00:00
|
|
|
- pod_origin.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
2016-02-02 19:20:53 +00:00
|
|
|
- name: test create pod
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
start_ip: 10.100.10.101
|
|
|
|
gateway: 10.100.10.1
|
|
|
|
netmask: 255.255.255.0
|
|
|
|
register: pod_origin
|
|
|
|
- name: verify test create pod
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod_origin is changed
|
2016-02-02 19:20:53 +00:00
|
|
|
- pod_origin.allocation_state == "Enabled"
|
|
|
|
- pod_origin.start_ip == "10.100.10.101"
|
|
|
|
- pod_origin.end_ip == "10.100.10.254"
|
|
|
|
- pod_origin.gateway == "10.100.10.1"
|
|
|
|
- pod_origin.netmask == "255.255.255.0"
|
|
|
|
- pod_origin.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
|
|
|
- name: test create pod idempotence
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
start_ip: 10.100.10.101
|
|
|
|
gateway: 10.100.10.1
|
|
|
|
netmask: 255.255.255.0
|
|
|
|
register: pod
|
|
|
|
- name: verify test create pod idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is not changed
|
2016-02-02 19:20:53 +00:00
|
|
|
- pod.allocation_state == "Enabled"
|
|
|
|
- pod.start_ip == "10.100.10.101"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test update pod in check mode
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
start_ip: 10.100.10.102
|
|
|
|
gateway: 10.100.10.1
|
|
|
|
netmask: 255.255.255.0
|
|
|
|
register: pod
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test update pod in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is changed
|
2017-05-26 10:19:47 +00:00
|
|
|
- pod.allocation_state == "Enabled"
|
|
|
|
- pod.start_ip == "10.100.10.101"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
2016-02-02 19:20:53 +00:00
|
|
|
- name: test update pod
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
start_ip: 10.100.10.102
|
|
|
|
gateway: 10.100.10.1
|
|
|
|
netmask: 255.255.255.0
|
|
|
|
register: pod
|
|
|
|
- name: verify test update pod
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is changed
|
2016-02-02 19:20:53 +00:00
|
|
|
- pod.allocation_state == "Enabled"
|
|
|
|
- pod.start_ip == "10.100.10.102"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
|
|
|
- name: test update pod idempotence
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
start_ip: 10.100.10.102
|
|
|
|
gateway: 10.100.10.1
|
|
|
|
netmask: 255.255.255.0
|
|
|
|
register: pod
|
|
|
|
- name: verify test update pod idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is not changed
|
2016-02-02 19:20:53 +00:00
|
|
|
- pod.allocation_state == "Enabled"
|
|
|
|
- pod.start_ip == "10.100.10.102"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test disable pod in check mode
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
state: disabled
|
|
|
|
register: pod
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test enable pod in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is changed
|
2017-05-26 10:19:47 +00:00
|
|
|
- pod.allocation_state == "Enabled"
|
|
|
|
- pod.id == pod_origin.id
|
|
|
|
- pod.start_ip == "10.100.10.102"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
2016-02-02 19:20:53 +00:00
|
|
|
- name: test disable pod
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
state: disabled
|
|
|
|
register: pod
|
|
|
|
- name: verify test enable pod
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is changed
|
2016-02-02 19:20:53 +00:00
|
|
|
- pod.allocation_state == "Disabled"
|
|
|
|
- pod.id == pod_origin.id
|
|
|
|
- pod.start_ip == "10.100.10.102"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
|
|
|
- name: test disable pod idempotence
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
state: disabled
|
|
|
|
register: pod
|
|
|
|
- name: verify test enable pod idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is not changed
|
2016-02-02 19:20:53 +00:00
|
|
|
- pod.allocation_state == "Disabled"
|
|
|
|
- pod.id == pod_origin.id
|
|
|
|
- pod.start_ip == "10.100.10.102"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test enable pod in check mode
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
state: enabled
|
|
|
|
register: pod
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test disable pod in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is changed
|
2017-05-26 10:19:47 +00:00
|
|
|
- pod.allocation_state == "Disabled"
|
|
|
|
- pod.id == pod_origin.id
|
|
|
|
- pod.start_ip == "10.100.10.102"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
2016-02-02 19:20:53 +00:00
|
|
|
- name: test enable pod
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
state: enabled
|
|
|
|
register: pod
|
|
|
|
- name: verify test disable pod
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is changed
|
2016-02-02 19:20:53 +00:00
|
|
|
- pod.allocation_state == "Enabled"
|
|
|
|
- pod.id == pod_origin.id
|
|
|
|
- pod.start_ip == "10.100.10.102"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
|
|
|
|
|
|
|
- name: test enable pod idempotence
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
state: enabled
|
|
|
|
register: pod
|
|
|
|
- name: verify test enabled pod idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is not changed
|
2016-02-02 19:20:53 +00:00
|
|
|
- pod.allocation_state == "Enabled"
|
|
|
|
- pod.id == pod_origin.id
|
|
|
|
- pod.start_ip == "10.100.10.102"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test absent pod in check mode
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
state: absent
|
|
|
|
register: pod
|
|
|
|
check_mode: true
|
|
|
|
- name: verify test create pod in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is changed
|
2017-05-26 10:19:47 +00:00
|
|
|
- pod.id == pod_origin.id
|
|
|
|
- pod.allocation_state == "Enabled"
|
|
|
|
- pod.start_ip == "10.100.10.102"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
2016-02-02 19:20:53 +00:00
|
|
|
- name: test absent pod
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
state: absent
|
|
|
|
register: pod
|
|
|
|
- name: verify test create pod
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is changed
|
2016-02-02 19:20:53 +00:00
|
|
|
- pod.id == pod_origin.id
|
|
|
|
- pod.allocation_state == "Enabled"
|
|
|
|
- pod.start_ip == "10.100.10.102"
|
|
|
|
- pod.end_ip == "10.100.10.254"
|
|
|
|
- pod.gateway == "10.100.10.1"
|
|
|
|
- pod.netmask == "255.255.255.0"
|
|
|
|
- pod.zone == "{{ cs_resource_prefix }}-zone"
|
|
|
|
|
|
|
|
- name: test absent pod idempotence
|
|
|
|
cs_pod:
|
|
|
|
name: "{{ cs_resource_prefix }}-pod"
|
|
|
|
zone: "{{ cs_resource_prefix }}-zone"
|
|
|
|
state: absent
|
|
|
|
register: pod
|
|
|
|
- name: verify test absent pod idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- pod is not changed
|