microsoft.ad.fs_trust module – Manage AD FS Relying Party Trusts
Note
This module is part of the microsoft.ad collection (version 1.11.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install microsoft.ad.
To use it in a playbook, specify: microsoft.ad.fs_trust.
New in microsoft.ad 1.11.0
Synopsis
Create, update, or remove AD FS Relying Party Trusts on a Windows server running the AD FS role.
Trusts can be created from a federation metadata URL, a local metadata XML file, or by specifying identifiers and endpoints manually.
Parameters
Parameter |
Comments |
|---|---|
Name of the access control policy to assign. |
|
Whether changes in the federation metadata are automatically applied to the trust configuration. Choices:
|
|
Whether the relying party trust is enabled. Choices:
|
|
Whether claims sent to the relying party should be encrypted. Choices:
|
|
List of unique identifiers (URIs) for the relying party trust. Used for manual trust setup without a metadata document. Mutually exclusive with |
|
Local file path to a federation metadata XML document. Mutually exclusive with |
|
URL pointing to the federation metadata document for the relying party. The module tests connectivity to this URL before creating the trust. Mutually exclusive with |
|
Whether periodic monitoring of the relying party federation metadata is enabled. Requires that the trust was created with Choices:
|
|
The display name of the relying party trust. This is the primary key used to identify the trust. |
|
Freeform notes for the relying party trust. |
|
List of SAML Assertion Consumer Service endpoint URLs. Only used when creating a trust with Each URL is registered as a SAML POST binding endpoint. |
|
Signature algorithm used for signing and verification.
Choices:
|
|
Whether the relying party trust should be present or absent. Choices:
|
|
Token validity duration in minutes. |
|
WS-Federation passive endpoint URL for the relying party. Only used when creating a trust with |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Can run in check_mode and return changed status prediction without modifying target, if not supported the action will be skipped. |
|
Support: none |
Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode |
|
Platform: windows |
Target OS/families that can be operated against |
Notes
Note
This module must be run on a Windows server with the AD FS role installed.
The AD FS PowerShell module (ADFS) must be available on the target.
Requires AD FS administrator permissions.
Supports AD FS on Windows Server 2019 and later.
See Also
See also
- Add-AdfsRelyingPartyTrust
Microsoft documentation for the underlying cmdlet.
Examples
- name: Create a relying party trust from a metadata URL
microsoft.ad.fs_trust:
name: MyApp
metadata_url: https://app.example.com/federationmetadata/2007-06/federationmetadata.xml
monitoring_enabled: true
auto_update_enabled: true
- name: Create a relying party trust from a local metadata file
microsoft.ad.fs_trust:
name: InternalApp
metadata_file: C:\metadata\internal_app.xml
enabled: true
- name: Create a trust with manual identifiers and SAML endpoint
microsoft.ad.fs_trust:
name: CustomSaaS
identifier:
- https://app.example.com/saml
saml_endpoint:
- https://app.example.com/saml/acs
enabled: true
token_lifetime: 60
- name: Create a trust with a WS-Federation endpoint
microsoft.ad.fs_trust:
name: WsFedApp
identifier:
- https://wsfed.example.com/
wsfed_endpoint: https://wsfed.example.com/auth
access_control_policy_name: Permit everyone
- name: Update monitoring on an existing trust
microsoft.ad.fs_trust:
name: MyApp
metadata_url: https://app.example.com/federationmetadata/2007-06/federationmetadata.xml
monitoring_enabled: true
- name: Remove a relying party trust
microsoft.ad.fs_trust:
name: MyApp
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether the trust is enabled. Returned: success and state is present Sample: |
|
The list of identifiers for the relying party trust. Returned: success and state is present Sample: |
|
Whether metadata monitoring is enabled. Returned: success and state is present Sample: |