mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-07 22:03:09 +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:
|
||||||
|
|||||||
@@ -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,19 +1,27 @@
|
|||||||
---
|
---
|
||||||
- name: Create test project
|
- module_defaults:
|
||||||
|
group/openstack.cloud.openstack:
|
||||||
|
cloud: "{{ cloud }}"
|
||||||
|
name: "{{ test_project }}"
|
||||||
|
# Backward compatibility with Ansible 2.9
|
||||||
openstack.cloud.project:
|
openstack.cloud.project:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
state: present
|
|
||||||
name: "{{ test_project }}"
|
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
|
||||||
name: "{{ test_project }}"
|
|
||||||
register: default_quotas
|
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
|
||||||
@@ -26,7 +34,7 @@
|
|||||||
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
|
||||||
@@ -34,7 +42,7 @@
|
|||||||
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
|
||||||
@@ -47,7 +55,7 @@
|
|||||||
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
|
||||||
@@ -55,7 +63,7 @@
|
|||||||
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
|
||||||
@@ -68,13 +76,11 @@
|
|||||||
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 }}"
|
|
||||||
name: "{{ test_project }}"
|
|
||||||
state: absent
|
state: absent
|
||||||
register: quotas
|
register: quotas
|
||||||
|
|
||||||
@@ -84,8 +90,7 @@
|
|||||||
|
|
||||||
- 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
|
||||||
@@ -109,8 +114,7 @@
|
|||||||
|
|
||||||
- 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
|
||||||
@@ -119,13 +123,9 @@
|
|||||||
|
|
||||||
- name: Unset all quotas
|
- name: Unset all quotas
|
||||||
openstack.cloud.quota:
|
openstack.cloud.quota:
|
||||||
cloud: "{{ cloud }}"
|
|
||||||
name: "{{ test_project }}"
|
|
||||||
state: absent
|
state: absent
|
||||||
register: quotas
|
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