From 1387aec1db8e665a35b17f07b076e5cbd9ee53d0 Mon Sep 17 00:00:00 2001 From: Taavi Ansper Date: Fri, 20 Mar 2026 14:29:23 +0200 Subject: [PATCH] Add schema_version property to federation_mapping Closes-Bug: #2145020 Change-Id: Id4e19dd4d63ae083280a78863a6cdecbd043ea7c Signed-off-by: Taavi Ansper --- plugins/modules/federation_mapping.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/modules/federation_mapping.py b/plugins/modules/federation_mapping.py index 6603a3d2..ae1126ee 100644 --- a/plugins/modules/federation_mapping.py +++ b/plugins/modules/federation_mapping.py @@ -40,6 +40,13 @@ options: required: true type: list elements: dict + schema_version: + description: + - The federated attribute mapping schema version. + The default value on the client side is 'None'; + however, that will lead the backend to set the default according + to 'attribute_mapping_default_schema_version' option. + type: str state: description: - Whether the mapping should be C(present) or C(absent). @@ -69,6 +76,7 @@ EXAMPLES = r''' any_one_of: - Contractor - SubContractor + schema_version: '1.0' - name: Delete a mapping openstack.cloud.federation_mapping: @@ -93,6 +101,9 @@ mapping: rules: description: List of rules for the mapping type: list + schema_version: + description: Schema version of the mapping + type: str ''' from ansible_collections.openstack.cloud.plugins.module_utils.openstack import OpenStackModule @@ -108,6 +119,7 @@ class IdentityFederationMappingModule(OpenStackModule): local=dict(required=True, type='list', elements='dict'), remote=dict(required=True, type='list', elements='dict') )), + schema_version=dict(default=None), state=dict(default='present', choices=['absent', 'present']), ) @@ -155,7 +167,7 @@ class IdentityFederationMappingModule(OpenStackModule): if len(self.params['rules']) < 1: self.fail_json(msg='At least one rule must be passed') - attributes = dict((k, self.params[k]) for k in ['rules'] + attributes = dict((k, self.params[k]) for k in ['rules', 'schema_version'] if k in self.params and self.params[k] is not None and self.params[k] != mapping[k]) @@ -166,7 +178,8 @@ class IdentityFederationMappingModule(OpenStackModule): def _create(self): return self.conn.identity.create_mapping(id=self.params['name'], - rules=self.params['rules']) + rules=self.params['rules'], + schema_version=self.params['schema_version']) def _delete(self, mapping): self.conn.identity.delete_mapping(mapping.id)