1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/cs_resourcelimit/tasks/main.yml
René Moser d5b04aa1f1 cloudstack: add check mode tests (#24908)
* cloudstack: test: cs_network_acl: add check_mode tests

* cloudstack: test: cs_pod: add check_mode tests

* cloudstack: test: cs_user: add check_mode tests

* cloudstack: test: cs_sshkeypair: add check_mode tests

* cloudstack: test: cs_project: add check_mode tests

* cloudstack: test: cs_vpc: add check_mode tests

* cloudstack: test: cs_vpn_gateway: add check_mode tests

* cloudstack: test: cs_volume: add check_mode tests

* cloudstack: test: cs_vmsnapshot: add check_mode tests

* cloudstack: test: cs_account: add check_mode tests

* cloudstack: test: cs_affinitygroup: add check_mode tests

* cloudstack: test: cs_cluster: add check_mode tests

* cloudstack: test: cs_domain: add check_mode tests

* cloudstack: test: cs_instancegroup: add check_mode tests

* cloudstack: test: cs_iso: add check_mode tests

* cloudstack: test: cs_loadbalancer_rule: add check_mode tests

* cloudstack: test: cs_portforward: add check_mode tests

* cloudstack: test: cs_resourcelimit: add check_mode tests

* cloudstack: test: cs_securitygroup: add check_mode tests

* cloudstack: test: cs_securitygroup_rule: add check_mode tests

* cloudstack: test: cs_configuration: add check_mode tests

* cloudstack: test: cs_firewall: add check_mode tests

* cloudstack: test: cs_instance: add check_mode tests

* cloudstack: query current tags from API

Fixes unexpected tags returned in check mode.
2017-05-26 12:19:47 +02:00

104 lines
2.5 KiB
YAML

---
- name: setup domain
cs_domain: path={{ cs_resource_prefix }}-domain
register: dom
- name: verify setup domain
assert:
that:
- dom|success
- name: setup account
cs_account:
name: "{{ cs_resource_prefix }}_user"
username: "{{ cs_resource_prefix }}_username"
password: "{{ cs_resource_prefix }}_password"
last_name: "{{ cs_resource_prefix }}_last_name"
first_name: "{{ cs_resource_prefix }}_first_name"
email: "{{ cs_resource_prefix }}@example.com"
network_domain: "{{ cs_resource_prefix }}-local"
domain: "{{ cs_resource_prefix }}-domain"
register: acc
- name: verify setup account
assert:
that:
- acc|success
- name: test failed unkonwn type
cs_resourcelimit:
type: unkonwn
limit: 20
domain: "{{ cs_resource_prefix }}-domain"
register: rl
ignore_errors: yes
- name: verify test failed unkonwn type
assert:
that:
- rl|failed
- name: test failed missing type
cs_resourcelimit:
register: rl
ignore_errors: yes
- name: verify test failed missing type
assert:
that:
- rl|failed
- name: setup resource limits domain
cs_resourcelimit:
type: instance
limit: 10
domain: "{{ cs_resource_prefix }}-domain"
register: rl
- name: verify setup resource limits domain
assert:
that:
- rl|success
- rl.domain == "{{ cs_resource_prefix }}-domain"
- rl.limit == 10
- name: set resource limits domain to 20 in check mode
cs_resourcelimit:
type: instance
limit: 20
domain: "{{ cs_resource_prefix }}-domain"
register: rl
check_mode: true
- name: verify setup resource limits domain to 20 in check mode
assert:
that:
- rl|success
- rl|changed
- rl.domain == "{{ cs_resource_prefix }}-domain"
- rl.limit == 10
- name: set resource limits domain to 20
cs_resourcelimit:
type: instance
limit: 20
domain: "{{ cs_resource_prefix }}-domain"
register: rl
- name: verify setup resource limits domain to 20
assert:
that:
- rl|success
- rl|changed
- rl.domain == "{{ cs_resource_prefix }}-domain"
- rl.limit == 20
- name: set resource limits domain to 20 idempotence
cs_resourcelimit:
type: instance
limit: 20
domain: "{{ cs_resource_prefix }}-domain"
register: rl
- name: verify setup resource limits domain to 20 idempotence
assert:
that:
- rl|success
- not rl|changed
- rl.domain == "{{ cs_resource_prefix }}-domain"
- rl.limit == 20
- include: instance.yml
- include: cpu.yml