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:
|
|
|
|
- dom|success
|
|
|
|
|
|
|
|
- name: test fail if missing name
|
|
|
|
action: cs_domain
|
|
|
|
register: dom
|
|
|
|
ignore_errors: true
|
|
|
|
- name: verify results of fail if missing params
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- dom|failed
|
|
|
|
- '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:
|
|
|
|
- dom|failed
|
|
|
|
- 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:
|
|
|
|
- dom|changed
|
|
|
|
|
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:
|
|
|
|
- dom|changed
|
|
|
|
- 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:
|
|
|
|
- not dom|changed
|
|
|
|
- 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:
|
|
|
|
- not dom|changed
|
|
|
|
- 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:
|
|
|
|
- dom|failed
|
|
|
|
- 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:
|
|
|
|
- dom|changed
|
|
|
|
|
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:
|
|
|
|
- dom|changed
|
|
|
|
- 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:
|
|
|
|
- not dom|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:
|
|
|
|
- dom|changed
|
|
|
|
- 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:
|
|
|
|
- dom|changed
|
|
|
|
- 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:
|
|
|
|
- not dom|changed
|
|
|
|
- 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:
|
|
|
|
- dom|changed
|
|
|
|
- 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:
|
|
|
|
- dom|changed
|
|
|
|
- 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:
|
|
|
|
- not dom|changed
|
|
|
|
|
|
|
|
- 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:
|
|
|
|
- dom|changed
|
|
|
|
- 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:
|
|
|
|
- dom|changed
|
|
|
|
- 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:
|
|
|
|
- dom|changed
|
|
|
|
- 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:
|
|
|
|
- not dom|changed
|