mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-08 06:13:13 +00:00
New Module: os_keystone_identity_provider_info
Add support for fetching the information about federation IDPs Change-Id: I36b7fa264866689e09b020b13b7bdc3843bfacfb
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
cloud: "{{ cloud }}"
|
||||
openstack.cloud.os_keystone_identity_provider:
|
||||
cloud: "{{ cloud }}"
|
||||
#openstack.cloud.os_keystone_identity_provider_info:
|
||||
# cloud: "{{ cloud }}"
|
||||
openstack.cloud.os_keystone_identity_provider_info:
|
||||
cloud: "{{ cloud }}"
|
||||
block:
|
||||
# ========================================================================
|
||||
# Initial setup
|
||||
@@ -56,14 +56,14 @@
|
||||
- create_idp is successful
|
||||
- create_idp is changed
|
||||
|
||||
#- name: 'Fetch identity_provider info (provider should be absent)'
|
||||
# openstack.cloud.os_keystone_identity_provider_info:
|
||||
# name: '{{ idp_name }}'
|
||||
# register: identity_provider_info
|
||||
# ignore_errors: yes
|
||||
#- assert:
|
||||
# that:
|
||||
# - identity_provider_info is failed
|
||||
- name: 'Fetch identity_provider info (provider should be absent)'
|
||||
openstack.cloud.os_keystone_identity_provider_info:
|
||||
name: '{{ idp_name }}'
|
||||
register: identity_provider_info
|
||||
ignore_errors: yes
|
||||
- assert:
|
||||
that:
|
||||
- identity_provider_info is failed
|
||||
|
||||
- name: 'Create IDP'
|
||||
openstack.cloud.os_keystone_identity_provider:
|
||||
@@ -93,53 +93,53 @@
|
||||
vars:
|
||||
idp: '{{ create_identity_provider.identity_provider }}'
|
||||
|
||||
#- name: 'Fetch IDP info - with name'
|
||||
# openstack.cloud.os_keystone_identity_provider_info:
|
||||
# name: '{{ idp_name }}'
|
||||
# register: identity_provider_info
|
||||
#- assert:
|
||||
# that:
|
||||
# - identity_provider_info is successful
|
||||
# - '"identity_providers" in identity_provider_info'
|
||||
# - idps | length == 1
|
||||
# - '"id" in idp'
|
||||
# - '"name" in idp'
|
||||
# - '"domain_id" in idp'
|
||||
# - '"description" in idp'
|
||||
# - '"enabled" in idp'
|
||||
# - '"is_enabled" in idp'
|
||||
# - '"remote_ids" in idp'
|
||||
# - idp.id == idp_name
|
||||
# - idp.name == idp_name
|
||||
# - idp.domain_id == domain_id
|
||||
# - not idp.description
|
||||
# - idp.enabled == True
|
||||
# - idp.is_enabled == True
|
||||
# - idp.remote_ids == []
|
||||
# vars:
|
||||
# idps: '{{ identity_provider_info.identity_providers }}'
|
||||
# idp: '{{ identity_provider_info.identity_providers[0] }}'
|
||||
- name: 'Fetch IDP info - with name'
|
||||
openstack.cloud.os_keystone_identity_provider_info:
|
||||
name: '{{ idp_name }}'
|
||||
register: identity_provider_info
|
||||
- assert:
|
||||
that:
|
||||
- identity_provider_info is successful
|
||||
- '"identity_providers" in identity_provider_info'
|
||||
- idps | length == 1
|
||||
- '"id" in idp'
|
||||
- '"name" in idp'
|
||||
- '"domain_id" in idp'
|
||||
- '"description" in idp'
|
||||
- '"enabled" in idp'
|
||||
- '"is_enabled" in idp'
|
||||
- '"remote_ids" in idp'
|
||||
- idp.id == idp_name
|
||||
- idp.name == idp_name
|
||||
- idp.domain_id == domain_id
|
||||
- not idp.description
|
||||
- idp.enabled == True
|
||||
- idp.is_enabled == True
|
||||
- idp.remote_ids == []
|
||||
vars:
|
||||
idps: '{{ identity_provider_info.identity_providers }}'
|
||||
idp: '{{ identity_provider_info.identity_providers[0] }}'
|
||||
|
||||
#- name: 'Fetch identity_provider info - without name'
|
||||
# openstack.cloud.os_keystone_identity_provider_info: {}
|
||||
# register: identity_provider_info
|
||||
#- assert:
|
||||
# that:
|
||||
# - identity_provider_info is successful
|
||||
# - '"identity_providers" in identity_provider_info'
|
||||
# # In CI we generally have a clean slate, but this might
|
||||
# # not be true for everyone...
|
||||
# - idps | length >= 1
|
||||
# - '"id" in idp'
|
||||
# - '"name" in idp'
|
||||
# - '"domain_id" in idp'
|
||||
# - '"description" in idp'
|
||||
# - '"enabled" in idp'
|
||||
# - '"is_enabled" in idp'
|
||||
# - '"remote_ids" in idp'
|
||||
# vars:
|
||||
# idps: '{{ identity_provider_info.identity_providers }}'
|
||||
# idp: '{{ identity_provider_info.identity_providers[0] }}'
|
||||
- name: 'Fetch identity_provider info - without name'
|
||||
openstack.cloud.os_keystone_identity_provider_info: {}
|
||||
register: identity_provider_info
|
||||
- assert:
|
||||
that:
|
||||
- identity_provider_info is successful
|
||||
- '"identity_providers" in identity_provider_info'
|
||||
# In CI we generally have a clean slate, but this might
|
||||
# not be true for everyone...
|
||||
- idps | length >= 1
|
||||
- '"id" in idp'
|
||||
- '"name" in idp'
|
||||
- '"domain_id" in idp'
|
||||
- '"description" in idp'
|
||||
- '"enabled" in idp'
|
||||
- '"is_enabled" in idp'
|
||||
- '"remote_ids" in idp'
|
||||
vars:
|
||||
idps: '{{ identity_provider_info.identity_providers }}'
|
||||
idp: '{{ identity_provider_info.identity_providers[0] }}'
|
||||
|
||||
- name: 'Create identity_provider (retry - no change) - CHECK_MODE'
|
||||
check_mode: yes
|
||||
@@ -651,74 +651,74 @@
|
||||
vars:
|
||||
idp: '{{ create_identity_provider.identity_provider }}'
|
||||
|
||||
## Attempt to ensure that if we search we only get the one we expect
|
||||
#- name: 'Fetch Complex IDP info - with name'
|
||||
# openstack.cloud.os_keystone_identity_provider_info:
|
||||
# name: '{{ idp_name_2 }}'
|
||||
# register: identity_provider_info
|
||||
#- assert:
|
||||
# that:
|
||||
# - identity_provider_info is successful
|
||||
# - '"identity_providers" in identity_provider_info'
|
||||
# - identity_provider_info.identity_providers | length == 1
|
||||
# - '"id" in idp'
|
||||
# - '"name" in idp'
|
||||
# - '"domain_id" in idp'
|
||||
# - '"description" in idp'
|
||||
# - '"enabled" in idp'
|
||||
# - '"is_enabled" in idp'
|
||||
# - '"remote_ids" in idp'
|
||||
# - idp.id == idp_name_2
|
||||
# - idp.name == idp_name_2
|
||||
# - idp.domain_id == domain_id
|
||||
# - idp.description == idp_description
|
||||
# - idp.enabled == False
|
||||
# - idp.is_enabled == False
|
||||
# - idp.remote_ids == remote_ids_3
|
||||
# vars:
|
||||
# idp: '{{ identity_provider_info.identity_providers[0] }}'
|
||||
# Attempt to ensure that if we search we only get the one we expect
|
||||
- name: 'Fetch Complex IDP info - with name'
|
||||
openstack.cloud.os_keystone_identity_provider_info:
|
||||
name: '{{ idp_name_2 }}'
|
||||
register: identity_provider_info
|
||||
- assert:
|
||||
that:
|
||||
- identity_provider_info is successful
|
||||
- '"identity_providers" in identity_provider_info'
|
||||
- identity_provider_info.identity_providers | length == 1
|
||||
- '"id" in idp'
|
||||
- '"name" in idp'
|
||||
- '"domain_id" in idp'
|
||||
- '"description" in idp'
|
||||
- '"enabled" in idp'
|
||||
- '"is_enabled" in idp'
|
||||
- '"remote_ids" in idp'
|
||||
- idp.id == idp_name_2
|
||||
- idp.name == idp_name_2
|
||||
- idp.domain_id == domain_id
|
||||
- idp.description == idp_description
|
||||
- idp.enabled == False
|
||||
- idp.is_enabled == False
|
||||
- idp.remote_ids == remote_ids_3
|
||||
vars:
|
||||
idp: '{{ identity_provider_info.identity_providers[0] }}'
|
||||
|
||||
## Ensure that if we do search we get both of the results we expect
|
||||
#- name: 'Fetch multiple IDP info - without name'
|
||||
# openstack.cloud.os_keystone_identity_provider_info: {}
|
||||
# register: identity_provider_info
|
||||
#- assert:
|
||||
# that:
|
||||
# - identity_provider_info is successful
|
||||
# - '"identity_providers" in identity_provider_info'
|
||||
# # In CI we generally have a clean slate, but this might
|
||||
# # not be true for everyone...
|
||||
# - identity_provider_info.identity_providers | length >= 2
|
||||
# - '"id" in idp_0'
|
||||
# - '"name" in idp_0'
|
||||
# - '"domain_id" in idp_0'
|
||||
# - '"description" in idp_0'
|
||||
# - '"enabled" in idp_0'
|
||||
# - '"is_enabled" in idp_0'
|
||||
# - '"remote_ids" in idp_0'
|
||||
# - '"id" in idp_1'
|
||||
# - '"name" in idp_1'
|
||||
# - '"domain_id" in idp_1'
|
||||
# - '"description" in idp_1'
|
||||
# - '"enabled" in idp_1'
|
||||
# - '"is_enabled" in idp_1'
|
||||
# - '"remote_ids" in idp_1'
|
||||
# # In theory these could be attached to different IDPs but let's keep
|
||||
# # things simple
|
||||
# - idp_name in (identity_provider_info.identity_providers | map(attribute='id'))
|
||||
# - idp_name in (identity_provider_info.identity_providers | map(attribute='name'))
|
||||
# - idp_name_2 in (identity_provider_info.identity_providers | map(attribute='id'))
|
||||
# - idp_name_2 in (identity_provider_info.identity_providers | map(attribute='name'))
|
||||
# - domain_id in (identity_provider_info.identity_providers | map(attribute='domain_id'))
|
||||
# - idp_description in (identity_provider_info.identity_providers | map(attribute='description'))
|
||||
# - idp_description_2 in (identity_provider_info.identity_providers | map(attribute='description'))
|
||||
# - True in (identity_provider_info.identity_providers | map(attribute='enabled'))
|
||||
# - False in (identity_provider_info.identity_providers | map(attribute='enabled'))
|
||||
# - True in (identity_provider_info.identity_providers | map(attribute='is_enabled'))
|
||||
# - False in (identity_provider_info.identity_providers | map(attribute='is_enabled'))
|
||||
# vars:
|
||||
# idp_0: '{{ identity_provider_info.identity_providers[0] }}'
|
||||
# idp_1: '{{ identity_provider_info.identity_providers[1] }}'
|
||||
# Ensure that if we do search we get both of the results we expect
|
||||
- name: 'Fetch multiple IDP info - without name'
|
||||
openstack.cloud.os_keystone_identity_provider_info: {}
|
||||
register: identity_provider_info
|
||||
- assert:
|
||||
that:
|
||||
- identity_provider_info is successful
|
||||
- '"identity_providers" in identity_provider_info'
|
||||
# In CI we generally have a clean slate, but this might
|
||||
# not be true for everyone...
|
||||
- identity_provider_info.identity_providers | length >= 2
|
||||
- '"id" in idp_0'
|
||||
- '"name" in idp_0'
|
||||
- '"domain_id" in idp_0'
|
||||
- '"description" in idp_0'
|
||||
- '"enabled" in idp_0'
|
||||
- '"is_enabled" in idp_0'
|
||||
- '"remote_ids" in idp_0'
|
||||
- '"id" in idp_1'
|
||||
- '"name" in idp_1'
|
||||
- '"domain_id" in idp_1'
|
||||
- '"description" in idp_1'
|
||||
- '"enabled" in idp_1'
|
||||
- '"is_enabled" in idp_1'
|
||||
- '"remote_ids" in idp_1'
|
||||
# In theory these could be attached to different IDPs but let's keep
|
||||
# things simple
|
||||
- idp_name in (identity_provider_info.identity_providers | map(attribute='id'))
|
||||
- idp_name in (identity_provider_info.identity_providers | map(attribute='name'))
|
||||
- idp_name_2 in (identity_provider_info.identity_providers | map(attribute='id'))
|
||||
- idp_name_2 in (identity_provider_info.identity_providers | map(attribute='name'))
|
||||
- domain_id in (identity_provider_info.identity_providers | map(attribute='domain_id'))
|
||||
- idp_description in (identity_provider_info.identity_providers | map(attribute='description'))
|
||||
- idp_description_2 in (identity_provider_info.identity_providers | map(attribute='description'))
|
||||
- True in (identity_provider_info.identity_providers | map(attribute='enabled'))
|
||||
- False in (identity_provider_info.identity_providers | map(attribute='enabled'))
|
||||
- True in (identity_provider_info.identity_providers | map(attribute='is_enabled'))
|
||||
- False in (identity_provider_info.identity_providers | map(attribute='is_enabled'))
|
||||
vars:
|
||||
idp_0: '{{ identity_provider_info.identity_providers[0] }}'
|
||||
idp_1: '{{ identity_provider_info.identity_providers[1] }}'
|
||||
|
||||
- name: 'Delete identity_provider - CHECK_MODE'
|
||||
check_mode: yes
|
||||
@@ -762,14 +762,14 @@
|
||||
- delete_identity_provider is successful
|
||||
- delete_identity_provider is not changed
|
||||
|
||||
#- name: 'Fetch identity_provider info after deletion'
|
||||
# openstack.cloud.os_keystone_identity_provider_info:
|
||||
# name: '{{ idp_name }}'
|
||||
# register: identity_provider_info
|
||||
# ignore_errors: True
|
||||
#- assert:
|
||||
# that:
|
||||
# - identity_provider_info is failed
|
||||
- name: 'Fetch identity_provider info after deletion'
|
||||
openstack.cloud.os_keystone_identity_provider_info:
|
||||
name: '{{ idp_name }}'
|
||||
register: identity_provider_info
|
||||
ignore_errors: True
|
||||
- assert:
|
||||
that:
|
||||
- identity_provider_info is failed
|
||||
|
||||
- name: 'Delete second identity_provider'
|
||||
openstack.cloud.os_keystone_identity_provider:
|
||||
|
||||
Reference in New Issue
Block a user