mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-07 05:43:15 +00:00
Use module defaults groups in ci integration tests to reduce code bloat
Change-Id: I1370f5bcde602f63b4763c487f027677e79c73b0
This commit is contained in:
@@ -6,21 +6,21 @@
|
|||||||
# - Retry change (noop)
|
# - Retry change (noop)
|
||||||
#
|
#
|
||||||
- module_defaults:
|
- module_defaults:
|
||||||
# meta/action_groups.yml glue seems to be missing
|
group/openstack.cloud.openstack:
|
||||||
# group/os:
|
cloud: "{{ cloud }}"
|
||||||
# cloud: "{{ cloud }}"
|
openstack.cloud.keystone_federation_protocol:
|
||||||
|
cloud: "{{ cloud }}" # Backward compatibility with Ansible 2.9
|
||||||
|
idp_id: "{{ idp_name }}"
|
||||||
|
openstack.cloud.keystone_federation_protocol_info:
|
||||||
|
cloud: "{{ cloud }}" # Backward compatibility with Ansible 2.9
|
||||||
|
idp_id: "{{ idp_name }}"
|
||||||
|
# Backward compatibility with Ansible 2.9
|
||||||
openstack.cloud.identity_domain:
|
openstack.cloud.identity_domain:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
openstack.cloud.federation_idp:
|
openstack.cloud.federation_idp:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
openstack.cloud.federation_mapping:
|
openstack.cloud.federation_mapping:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
openstack.cloud.keystone_federation_protocol:
|
|
||||||
cloud: "{{ cloud }}"
|
|
||||||
idp_id: "{{ idp_name }}"
|
|
||||||
openstack.cloud.keystone_federation_protocol_info:
|
|
||||||
cloud: "{{ cloud }}"
|
|
||||||
idp_id: "{{ idp_name }}"
|
|
||||||
block:
|
block:
|
||||||
# ========================================================================
|
# ========================================================================
|
||||||
# Initial setup
|
# Initial setup
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
# - Retry change (noop)
|
# - Retry change (noop)
|
||||||
#
|
#
|
||||||
- module_defaults:
|
- module_defaults:
|
||||||
# meta/action_groups.yml glue seems to be missing
|
group/openstack.cloud.openstack:
|
||||||
# group/os:
|
cloud: "{{ cloud }}"
|
||||||
# cloud: "{{ cloud }}"
|
# Backward compatibility with Ansible 2.9
|
||||||
openstack.cloud.identity_domain:
|
openstack.cloud.identity_domain:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
openstack.cloud.federation_idp:
|
openstack.cloud.federation_idp:
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
- module_defaults:
|
- module_defaults:
|
||||||
# meta/action_groups.yml glue seems to be missing
|
group/openstack.cloud.openstack:
|
||||||
# group/os:
|
cloud: "{{ cloud }}"
|
||||||
# cloud: "{{ cloud }}"
|
# Backward compatibility with Ansible 2.9
|
||||||
openstack.cloud.federation_mapping:
|
openstack.cloud.federation_mapping:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
openstack.cloud.federation_mapping_info:
|
openstack.cloud.federation_mapping_info:
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
---
|
---
|
||||||
- module_defaults:
|
- module_defaults:
|
||||||
|
group/openstack.cloud.openstack:
|
||||||
|
cloud: "{{ cloud }}"
|
||||||
|
# Backward compatibility with Ansible 2.9
|
||||||
openstack.cloud.object_container:
|
openstack.cloud.object_container:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
block:
|
block:
|
||||||
@@ -57,4 +60,4 @@
|
|||||||
openstack.cloud.object_container:
|
openstack.cloud.object_container:
|
||||||
container: "{{ container_name }}"
|
container: "{{ container_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
test_project: ansible_project
|
test_project: ansible_project
|
||||||
quota_name_frag:
|
|
||||||
cloud: "{{ cloud }}"
|
|
||||||
name: "{{ test_project }}"
|
|
||||||
test_network_quota:
|
test_network_quota:
|
||||||
floating_ips: 5
|
floating_ips: 5
|
||||||
networks: 50
|
networks: 50
|
||||||
|
|||||||
@@ -1,131 +1,131 @@
|
|||||||
---
|
---
|
||||||
- name: Create test project
|
- module_defaults:
|
||||||
openstack.cloud.project:
|
group/openstack.cloud.openstack:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
state: present
|
name: "{{ test_project }}"
|
||||||
name: "{{ test_project }}"
|
# Backward compatibility with Ansible 2.9
|
||||||
|
openstack.cloud.project:
|
||||||
|
cloud: "{{ cloud }}"
|
||||||
|
name: "{{ test_project }}"
|
||||||
|
openstack.cloud.quota:
|
||||||
|
cloud: "{{ cloud }}"
|
||||||
|
name: "{{ test_project }}"
|
||||||
|
block:
|
||||||
|
- name: Create test project
|
||||||
|
openstack.cloud.project:
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Clear quotas before tests
|
- name: Clear quotas before tests
|
||||||
openstack.cloud.quota:
|
openstack.cloud.quota:
|
||||||
cloud: "{{ cloud }}"
|
state: absent
|
||||||
state: absent
|
register: default_quotas
|
||||||
name: "{{ test_project }}"
|
|
||||||
register: default_quotas
|
|
||||||
|
|
||||||
- name: Set network quota
|
- name: Set network quota
|
||||||
openstack.cloud.quota: "{{ test_network_quota | combine(quota_name_frag)}}"
|
openstack.cloud.quota: "{{ test_network_quota }}"
|
||||||
register: quotas
|
register: quotas
|
||||||
|
|
||||||
- name: Assert changed
|
- name: Assert changed
|
||||||
assert:
|
assert:
|
||||||
that: quotas is changed
|
that: quotas is changed
|
||||||
|
|
||||||
- name: Assert field values
|
- name: Assert field values
|
||||||
assert:
|
assert:
|
||||||
that: quotas.quotas.network[item.key] == item.value
|
that: quotas.quotas.network[item.key] == item.value
|
||||||
loop: "{{ test_network_quota | dict2items }}"
|
loop: "{{ test_network_quota | dict2items }}"
|
||||||
|
|
||||||
- name: Set network quota again
|
- name: Set network quota again
|
||||||
openstack.cloud.quota: "{{ test_network_quota | combine(quota_name_frag)}}"
|
openstack.cloud.quota: "{{ test_network_quota }}"
|
||||||
register: quotas
|
register: quotas
|
||||||
|
|
||||||
- name: Assert not changed
|
- name: Assert not changed
|
||||||
assert:
|
assert:
|
||||||
that: quotas is not changed
|
that: quotas is not changed
|
||||||
|
|
||||||
- name: Set volume quotas
|
- name: Set volume quotas
|
||||||
openstack.cloud.quota: "{{ test_volume_quota | combine(quota_name_frag)}}"
|
openstack.cloud.quota: "{{ test_volume_quota }}"
|
||||||
register: quotas
|
register: quotas
|
||||||
|
|
||||||
- name: Assert changed
|
- name: Assert changed
|
||||||
assert:
|
assert:
|
||||||
that: quotas is changed
|
that: quotas is changed
|
||||||
|
|
||||||
- name: Assert field values
|
- name: Assert field values
|
||||||
assert:
|
assert:
|
||||||
that: quotas.quotas.volume[item.key] == item.value
|
that: quotas.quotas.volume[item.key] == item.value
|
||||||
loop: "{{ test_volume_quota | dict2items }}"
|
loop: "{{ test_volume_quota | dict2items }}"
|
||||||
|
|
||||||
- name: Set volume quotas again
|
- name: Set volume quotas again
|
||||||
openstack.cloud.quota: "{{ test_volume_quota | combine(quota_name_frag)}}"
|
openstack.cloud.quota: "{{ test_volume_quota }}"
|
||||||
register: quotas
|
register: quotas
|
||||||
|
|
||||||
- name: Assert not changed
|
- name: Assert not changed
|
||||||
assert:
|
assert:
|
||||||
that: quotas is not changed
|
that: quotas is not changed
|
||||||
|
|
||||||
- name: Set compute quotas
|
- name: Set compute quotas
|
||||||
openstack.cloud.quota: "{{ test_compute_quota | combine(quota_name_frag)}}"
|
openstack.cloud.quota: "{{ test_compute_quota }}"
|
||||||
register: quotas
|
register: quotas
|
||||||
|
|
||||||
- name: Assert changed
|
- name: Assert changed
|
||||||
assert:
|
assert:
|
||||||
that: quotas is changed
|
that: quotas is changed
|
||||||
|
|
||||||
- name: Assert field values
|
- name: Assert field values
|
||||||
assert:
|
assert:
|
||||||
that: quotas.quotas.compute[item.key] == item.value
|
that: quotas.quotas.compute[item.key] == item.value
|
||||||
loop: "{{ test_compute_quota | dict2items }}"
|
loop: "{{ test_compute_quota | dict2items }}"
|
||||||
|
|
||||||
- name: Set compute quotas again
|
- name: Set compute quotas again
|
||||||
openstack.cloud.quota: "{{ test_compute_quota | combine(quota_name_frag)}}"
|
openstack.cloud.quota: "{{ test_compute_quota }}"
|
||||||
register: quotas
|
register: quotas
|
||||||
|
|
||||||
- name: Unset all quotas
|
- name: Unset all quotas
|
||||||
openstack.cloud.quota:
|
openstack.cloud.quota:
|
||||||
cloud: "{{ cloud }}"
|
state: absent
|
||||||
name: "{{ test_project }}"
|
register: quotas
|
||||||
state: absent
|
|
||||||
register: quotas
|
|
||||||
|
|
||||||
- name: Assert defaults restore
|
- name: Assert defaults restore
|
||||||
assert:
|
assert:
|
||||||
that: quotas.quotas == default_quotas.quotas
|
that: quotas.quotas == default_quotas.quotas
|
||||||
|
|
||||||
- name: Set all quotas at once
|
- name: Set all quotas at once
|
||||||
openstack.cloud.quota:
|
openstack.cloud.quota:
|
||||||
"{{ [test_network_quota, test_volume_quota, test_compute_quota,
|
"{{ [test_network_quota, test_volume_quota, test_compute_quota] | combine }}"
|
||||||
quota_name_frag] | combine }}"
|
register: quotas
|
||||||
register: quotas
|
|
||||||
|
|
||||||
- name: Assert changed
|
- name: Assert changed
|
||||||
assert:
|
assert:
|
||||||
that: quotas is changed
|
that: quotas is changed
|
||||||
|
|
||||||
- name: Assert volume values
|
- name: Assert volume values
|
||||||
assert:
|
assert:
|
||||||
that: quotas.quotas.volume[item.key] == item.value
|
that: quotas.quotas.volume[item.key] == item.value
|
||||||
loop: "{{ test_volume_quota | dict2items }}"
|
loop: "{{ test_volume_quota | dict2items }}"
|
||||||
|
|
||||||
- name: Assert network values
|
- name: Assert network values
|
||||||
assert:
|
assert:
|
||||||
that: quotas.quotas.network[item.key] == item.value
|
that: quotas.quotas.network[item.key] == item.value
|
||||||
loop: "{{ test_network_quota | dict2items }}"
|
loop: "{{ test_network_quota | dict2items }}"
|
||||||
|
|
||||||
- name: Assert compute values
|
- name: Assert compute values
|
||||||
assert:
|
assert:
|
||||||
that: quotas.quotas.compute[item.key] == item.value
|
that: quotas.quotas.compute[item.key] == item.value
|
||||||
loop: "{{ test_compute_quota | dict2items }}"
|
loop: "{{ test_compute_quota | dict2items }}"
|
||||||
|
|
||||||
- name: Set all quotas at once again
|
- name: Set all quotas at once again
|
||||||
openstack.cloud.quota:
|
openstack.cloud.quota:
|
||||||
"{{ [test_network_quota, test_volume_quota, test_compute_quota,
|
"{{ [test_network_quota, test_volume_quota, test_compute_quota] | combine }}"
|
||||||
quota_name_frag] | combine }}"
|
register: quotas
|
||||||
register: quotas
|
|
||||||
|
|
||||||
- name: Assert not changed
|
- name: Assert not changed
|
||||||
assert:
|
assert:
|
||||||
that: quotas is not changed
|
that: quotas is not changed
|
||||||
|
|
||||||
- name: Unset all quotas
|
- name: Unset all quotas
|
||||||
openstack.cloud.quota:
|
openstack.cloud.quota:
|
||||||
cloud: "{{ cloud }}"
|
state: absent
|
||||||
name: "{{ test_project }}"
|
register: quotas
|
||||||
state: absent
|
|
||||||
register: quotas
|
|
||||||
|
|
||||||
- name: Delete test project
|
- name: Delete test project
|
||||||
openstack.cloud.project:
|
openstack.cloud.project:
|
||||||
cloud: "{{ cloud }}"
|
state: absent
|
||||||
state: absent
|
|
||||||
name: "{{ test_project }}"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user