Note
This plugin is part of the community.general collection (version 3.8.1).
You might already have this collection installed if you are using the ansible
package. 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 community.general
.
To use it in a playbook, specify: community.general.keycloak_clienttemplate
.
Parameter | Choices/Defaults | Comments | |
---|---|---|---|
attributes dictionary | A dict of further attributes for this client template. This can contain various configuration settings, though in the default installation of Keycloak as of 3.4, none are documented or known, so this is usually empty. | ||
auth_client_id string | Default: "admin-cli" | OpenID Connect client_id to authenticate to the API with. | |
auth_client_secret string | Client Secret to use in conjunction with auth_client_id (if required). | ||
auth_keycloak_url string / required | URL to the Keycloak instance. aliases: url | ||
auth_password string | Password to authenticate for API access with. aliases: password | ||
auth_realm string | Keycloak realm name to authenticate to for API access. | ||
auth_username string | Username to authenticate for API access with. aliases: username | ||
description string | Description of the client template in Keycloak | ||
full_scope_allowed boolean |
| Is the "Full Scope Allowed" feature set for this client template or not. This is 'fullScopeAllowed' in the Keycloak REST API. | |
id string | Id of client template to be worked on. This is usually a UUID. | ||
name string | Name of the client template | ||
protocol string |
| Type of client template (either openid-connect or saml . | |
protocol_mappers list / elements=dictionary | a list of dicts defining protocol mappers for this client template. This is 'protocolMappers' in the Keycloak REST API. | ||
config dictionary | Dict specifying the configuration options for the protocol mapper; the contents differ depending on the value of protocolMapper and are not documented other than by the source of the mappers and its parent class(es). An example is given below. It is easiest to obtain valid config values by dumping an already-existing protocol mapper configuration through check-mode in the "existing" field. | ||
consentRequired boolean |
| Specifies whether a user needs to provide consent to a client for this mapper to be active. | |
consentText string | The human-readable name of the consent the user is presented to accept. | ||
id string | Usually a UUID specifying the internal ID of this protocol mapper instance. | ||
name string | The name of this protocol mapper. | ||
protocol string |
| is either 'openid-connect' or 'saml', this specifies for which protocol this protocol mapper is active. | |
protocolMapper string | The Keycloak-internal name of the type of this protocol-mapper. While an exhaustive list is impossible to provide since this may be extended through SPIs by the user of Keycloak, by default Keycloak as of 3.4 ships with at least docker-v2-allow-all-mapper oidc-address-mapper oidc-full-name-mapper oidc-group-membership-mapper oidc-hardcoded-claim-mapper oidc-hardcoded-role-mapper oidc-role-name-mapper oidc-script-based-protocol-mapper oidc-sha256-pairwise-sub-mapper oidc-usermodel-attribute-mapper oidc-usermodel-client-role-mapper oidc-usermodel-property-mapper oidc-usermodel-realm-role-mapper oidc-usersessionmodel-note-mapper saml-group-membership-mapper saml-hardcode-attribute-mapper saml-hardcode-role-mapper saml-role-list-mapper saml-role-name-mapper saml-user-attribute-mapper saml-user-property-mapper saml-user-session-note-mapper An exhaustive list of available mappers on your installation can be obtained on the admin console by going to Server Info -> Providers and looking under 'protocol-mapper'. | ||
realm string | Default: "master" | Realm this client template is found in. | |
state string |
| State of the client template On present , the client template will be created (or updated if it exists already).On absent , the client template will be removed if it exists | |
token string added in 3.0.0 of community.general | Authentication token for Keycloak API. | ||
validate_certs boolean |
| Verify TLS certificates (do not disable this in production). |
Note
- name: Create or update Keycloak client template (minimal), authentication with credentials community.general.keycloak_client: auth_client_id: admin-cli auth_keycloak_url: https://auth.example.com/auth auth_realm: master auth_username: USERNAME auth_password: PASSWORD realm: master name: this_is_a_test delegate_to: localhost - name: Create or update Keycloak client template (minimal), authentication with token community.general.keycloak_clienttemplate: auth_client_id: admin-cli auth_keycloak_url: https://auth.example.com/auth auth_realm: master token: TOKEN realm: master name: this_is_a_test delegate_to: localhost - name: Delete Keycloak client template community.general.keycloak_client: auth_client_id: admin-cli auth_keycloak_url: https://auth.example.com/auth auth_realm: master auth_username: USERNAME auth_password: PASSWORD realm: master state: absent name: test01 delegate_to: localhost - name: Create or update Keycloak client template (with a protocol mapper) community.general.keycloak_client: auth_client_id: admin-cli auth_keycloak_url: https://auth.example.com/auth auth_realm: master auth_username: USERNAME auth_password: PASSWORD realm: master name: this_is_a_test protocol_mappers: - config: access.token.claim: True claim.name: "family_name" id.token.claim: True jsonType.label: String user.attribute: lastName userinfo.token.claim: True consentRequired: True consentText: "${familyName}" name: family name protocol: openid-connect protocolMapper: oidc-usermodel-property-mapper full_scope_allowed: false id: bce6f5e9-d7d3-4955-817e-c5b7f8d65b3f delegate_to: localhost
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
end_state dictionary | always | client template representation of client template after module execution (sample is truncated) Sample: {'description': 'test01', 'fullScopeAllowed': False, 'id': '9c3712ab-decd-481e-954f-76da7b006e5f', 'name': 'test01', 'protocol': 'saml'} |
existing dictionary | always | client template representation of existing client template (sample is truncated) Sample: {'description': 'test01', 'fullScopeAllowed': False, 'id': '9c3712ab-decd-481e-954f-76da7b006e5f', 'name': 'test01', 'protocol': 'saml'} |
msg string | always | Message as to what action was taken Sample: Client template testclient has been updated |
proposed dictionary | always | client template representation of proposed changes to client template Sample: {'name': 'test01'} |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/keycloak_clienttemplate_module.html