2015-08-23 20:48:32 +00:00
|
|
|
---
|
|
|
|
- name: setup
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: "{{ cs_resource_prefix }}_domain"
|
|
|
|
state: absent
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
|
|
|
- name: verify setup
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is successful
|
2015-08-23 20:48:32 +00:00
|
|
|
|
|
|
|
- name: test fail if missing name
|
|
|
|
action: cs_domain
|
|
|
|
register: dom
|
|
|
|
ignore_errors: true
|
|
|
|
- name: verify results of fail if missing params
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is failed
|
2015-08-23 20:48:32 +00:00
|
|
|
- 'dom.msg == "missing required arguments: path"'
|
|
|
|
|
|
|
|
- name: test fail if ends with /
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: "{{ cs_resource_prefix }}_domain/"
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
|
|
|
ignore_errors: true
|
|
|
|
- name: verify results of fail if ends with /
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is failed
|
2015-08-23 20:48:32 +00:00
|
|
|
- dom.msg == "Path '{{ cs_resource_prefix }}_domain/' must not end with /"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test create a domain in check mode
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: "{{ cs_resource_prefix }}_domain"
|
2017-05-26 10:19:47 +00:00
|
|
|
register: dom
|
|
|
|
check_mode: true
|
|
|
|
- name: verify results of test create a domain in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2017-05-26 10:19:47 +00:00
|
|
|
|
2015-08-23 20:48:32 +00:00
|
|
|
- name: test create a domain
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: "{{ cs_resource_prefix }}_domain"
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
|
|
|
- name: verify results of test create a domain
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2015-08-23 20:48:32 +00:00
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_domain"
|
|
|
|
|
|
|
|
- name: test create a domain idempotence
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: "{{ cs_resource_prefix }}_domain"
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
|
|
|
- name: verify results of test create a domain idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is not changed
|
2015-08-23 20:48:32 +00:00
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_domain"
|
|
|
|
|
2017-08-05 08:33:01 +00:00
|
|
|
- name: test create a domain idempotence2
|
|
|
|
cs_domain:
|
|
|
|
path: "/{{ cs_resource_prefix }}_domain"
|
|
|
|
register: dom
|
|
|
|
- name: verify results of test create a domain idempotence2
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is not changed
|
2017-08-05 08:33:01 +00:00
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_domain"
|
|
|
|
|
2017-05-27 23:31:00 +00:00
|
|
|
- name: test fail to create a subdomain for inexistent domain
|
|
|
|
cs_domain:
|
|
|
|
path: ROOT/inexistent/{{ cs_resource_prefix }}_subdomain
|
|
|
|
register: dom
|
|
|
|
ignore_errors: true
|
|
|
|
- name: test fail to create a subdomain for inexistent domain
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is failed
|
2017-05-27 23:31:00 +00:00
|
|
|
- dom.msg == "Parent domain path ROOT/inexistent does not exist"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test create a subdomain in check mode
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain
|
2017-05-26 10:19:47 +00:00
|
|
|
register: dom
|
|
|
|
check_mode: true
|
|
|
|
- name: verify results of test create a domain in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2017-05-26 10:19:47 +00:00
|
|
|
|
2015-08-23 20:48:32 +00:00
|
|
|
- name: test create a subdomain
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
|
|
|
- name: verify results of test create a domain
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2015-08-23 20:48:32 +00:00
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_subdomain"
|
|
|
|
|
|
|
|
- name: test create a subdomain idempotence
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
|
|
|
- name: verify results of test create a subdomain idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is not changed
|
2017-08-05 08:33:01 +00:00
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_subdomain"
|
|
|
|
|
|
|
|
- name: test update a subdomain in check mode
|
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain
|
|
|
|
network_domain: domain.example.com
|
|
|
|
register: dom
|
|
|
|
check_mode: true
|
|
|
|
- name: verify results of test update a subdomain in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2017-08-05 08:33:01 +00:00
|
|
|
- dom.network_domain is undefined
|
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_subdomain"
|
|
|
|
|
|
|
|
- name: test update a subdomain
|
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain
|
|
|
|
network_domain: domain.example.com
|
|
|
|
register: dom
|
|
|
|
- name: verify results of test update a subdomain
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2017-08-05 08:33:01 +00:00
|
|
|
- dom.network_domain == "domain.example.com"
|
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_subdomain"
|
|
|
|
|
|
|
|
- name: test update a subdomain idempotence
|
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain
|
|
|
|
network_domain: domain.example.com
|
|
|
|
register: dom
|
|
|
|
- name: verify results of test update a subdomain idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is not changed
|
2017-08-05 08:33:01 +00:00
|
|
|
- dom.network_domain == "domain.example.com"
|
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_subdomain"
|
2015-08-23 20:48:32 +00:00
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test delete a subdomain in check mode
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain
|
|
|
|
state: absent
|
2017-05-26 10:19:47 +00:00
|
|
|
register: dom
|
|
|
|
check_mode: true
|
|
|
|
- name: verify results of test delete a subdomain in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2017-05-26 10:19:47 +00:00
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_subdomain"
|
|
|
|
|
2015-08-23 20:48:32 +00:00
|
|
|
- name: test delete a subdomain
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain
|
|
|
|
state: absent
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: verify results of test delete a subdomain
|
2015-08-23 20:48:32 +00:00
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2015-08-23 20:48:32 +00:00
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_subdomain"
|
|
|
|
|
|
|
|
- name: test delete a subdomain idempotence
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain
|
|
|
|
state: absent
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
|
|
|
- name: verify results of test delete a subdomain idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is not changed
|
2015-08-23 20:48:32 +00:00
|
|
|
|
|
|
|
- name: test create a subdomain 2
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
|
|
|
- name: verify results of test create a subdomain 2
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2015-08-23 20:48:32 +00:00
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain/{{ cs_resource_prefix }}_subdomain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_subdomain"
|
|
|
|
|
2017-05-26 10:19:47 +00:00
|
|
|
- name: test delete a domain with clean up in check mode
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain
|
|
|
|
state: absent
|
|
|
|
clean_up: true
|
2017-05-26 10:19:47 +00:00
|
|
|
register: dom
|
|
|
|
check_mode: true
|
|
|
|
- name: verify results of test delete a domain with clean up in check mode
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2017-05-26 10:19:47 +00:00
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_domain"
|
|
|
|
|
2015-08-23 20:48:32 +00:00
|
|
|
- name: test delete a domain with clean up
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain
|
|
|
|
state: absent
|
|
|
|
clean_up: true
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
|
|
|
- name: verify results of test delete a domain with clean up
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is changed
|
2015-08-23 20:48:32 +00:00
|
|
|
- dom.path == "ROOT/{{ cs_resource_prefix }}_domain"
|
|
|
|
- dom.name == "{{ cs_resource_prefix }}_domain"
|
|
|
|
|
|
|
|
- name: test delete a domain with clean up idempotence
|
2017-08-05 08:33:01 +00:00
|
|
|
cs_domain:
|
|
|
|
path: ROOT/{{ cs_resource_prefix }}_domain
|
|
|
|
state: absent
|
|
|
|
clean_up: true
|
2015-08-23 20:48:32 +00:00
|
|
|
register: dom
|
|
|
|
- name: verify results of test delete a domain with clean up idempotence
|
|
|
|
assert:
|
|
|
|
that:
|
2017-11-27 22:58:08 +00:00
|
|
|
- dom is not changed
|