Ansible version compatibility
Tested with the Ansible Core >= 2.12.0 versions, and the current development version of Ansible. Ansible Core versions prior to 2.12.0 have not been tested.Python version compatibility
This collection depends on the Infisical SDK for Python. Requires Python 3.7 or greater.Installing this collection
You can install the Infisical collection with the Ansible Galaxy CLI:Using this collection
You can either call modules by their Fully Qualified Collection Name (FQCN), such asinfisical.vault.read_secrets, or you can call modules by their short name if you list the infisical.vault collection in the playbook’s collections keyword.
Authentication
The Infisical Ansible Collection supports Universal Auth, OIDC Auth, and Token Auth for authenticating against Infisical.Login Module (Recommended)
The recommended approach is to use thelogin module to authenticate once and reuse the credentials across multiple tasks. This reduces authentication overhead and makes playbooks cleaner. Alternatively, you can still pass credentials directly to each plugin/module if preferred.
Universal Auth
Universal Auth
Using Universal Auth for authentication is the most straight-forward way to get started with using the Ansible collection.To use Universal Auth, you need to provide the Client ID and Client Secret of your Infisical Machine Identity.You can also provide the
auth_method, universal_auth_client_id, and universal_auth_client_secret parameters through environment variables:| Parameter Name | Environment Variable Name |
|---|---|
auth_method | INFISICAL_AUTH_METHOD |
universal_auth_client_id | INFISICAL_UNIVERSAL_AUTH_CLIENT_ID |
universal_auth_client_secret | INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET |
OIDC Auth
OIDC Auth
To use OIDC Auth, you’ll need to provide the ID of your machine identity, and the OIDC JWT to be used for authentication.You can also provide the
Please note that in order to use OIDC Auth, you must have
1.0.10 or newer of the infisicalsdk package installed.auth_method, identity_id, and jwt parameters through environment variables:| Parameter Name | Environment Variable Name |
|---|---|
| auth_method | INFISICAL_AUTH_METHOD |
| identity_id | INFISICAL_IDENTITY_ID |
| jwt | INFISICAL_JWT |
Token Auth
Token Auth
Token Auth is the simplest authentication method that allows you to authenticate directly with an access token. This can be either a Machine Identity Token Auth token or a User JWT token.You can also provide the
Please note that in order to use Token Auth, you must have
1.0.13 or newer of the infisicalsdk package installed.auth_method and token parameters through environment variables:| Parameter Name | Environment Variable Name |
|---|---|
| auth_method | INFISICAL_AUTH_METHOD |
| token | INFISICAL_TOKEN |
Available Plugins and Modules
Lookup Plugins
infisical.vault.login- Authenticate and return reusable login datainfisical.vault.read_secrets- Read secrets from Infisical
Modules
Authentication:infisical.vault.login- Authenticate and return reusable login data
infisical.vault.read_secrets- Read secrets from Infisicalinfisical.vault.create_secret- Create a new secretinfisical.vault.update_secret- Update an existing secretinfisical.vault.delete_secret- Delete a secret
infisical.vault.create_dynamic_secret- Create a dynamic secret configurationinfisical.vault.get_dynamic_secret- Get a dynamic secret by nameinfisical.vault.update_dynamic_secret- Update a dynamic secretinfisical.vault.delete_dynamic_secret- Delete a dynamic secret
infisical.vault.create_dynamic_secret_lease- Create a lease (generates credentials)infisical.vault.get_dynamic_secret_lease- Get lease detailsinfisical.vault.renew_dynamic_secret_lease- Renew an existing leaseinfisical.vault.delete_dynamic_secret_lease- Delete/revoke a lease
Examples
Reading Secrets
Reading secrets with full metadata
Use theraw option to retrieve complete secret metadata including version, creation time, tags, and more:
Using the Lookup Plugin
Theread_secrets lookup plugin allows for inline secret retrieval. Unlike modules that run on target hosts, lookup plugins run on the Ansible controller during playbook parsing. This is useful for retrieving secrets to use in variable definitions:
Managing Secrets (CRUD)
Create, update, and delete secrets programmatically:Dynamic Secrets
Dynamic secrets generate credentials on-demand with automatic expiration. They support various providers like SQL databases, AWS, GCP, Azure, and more. For the full list of supported providers and their configuration options, see the Dynamic Secrets documentation.Creating a Dynamic Secret
For the full list of supported provider types and their input configurations, see the Dynamic Secrets API Documentation.
Getting and Using Dynamic Secret Credentials
To use a dynamic secret, you need to create a lease which generates the actual credentials:Managing Leases
Updating and Deleting Dynamic Secrets
Troubleshoot
I'm getting a error related to objc[72832]: +[__NSCFConstantString initialize]
I'm getting a error related to objc[72832]: +[__NSCFConstantString initialize]