Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

add ansible docs

adilson8bc13465a499
diff --git a/docs/integrations/platforms/ansible.mdx b/docs/integrations/platforms/ansible.mdx
index 61469c1245..e59cd21a96 100644
--- a/docs/integrations/platforms/ansible.mdx
+++ b/docs/integrations/platforms/ansible.mdx
@@ -186,6 +186,7 @@ The recommended approach is to use the `login` module to authenticate once and r
### Lookup plugins
- `infisical.vault.login` - Authenticate and return reusable login data
- `infisical.vault.read_secrets` - Read secrets from Infisical
+- `infisical.vault.read_folders` - Read folders from Infisical
### Modules
@@ -198,6 +199,12 @@ The recommended approach is to use the `login` module to authenticate once and r
- `infisical.vault.update_secret` - Update an existing secret
- `infisical.vault.delete_secret` - Delete a secret
+**Folders:**
+- `infisical.vault.create_folder` - Create a new folder
+- `infisical.vault.read_folders` - List folders at a path, or get one by ID
+- `infisical.vault.update_folder` - Rename or re-describe an existing folder
+- `infisical.vault.delete_folder` - Delete a folder
+
**Dynamic Secrets:**
- `infisical.vault.create_dynamic_secret` - Create a dynamic secret configuration
- `infisical.vault.get_dynamic_secret` - Get a dynamic secret by name
@@ -332,6 +339,82 @@ Create, update, and delete secrets programmatically:
register: deleted_secret
```
+### Managing folders
+
+[Folders](/documentation/platform/folder) are the path namespace that the `path` option on every secret module addresses. Create a folder before writing secrets into it.
+
+<Note>
+ Folder operations require `infisicalsdk` version 1.0.17 or newer. The modules fail with a clear message when the installed version is older.
+</Note>
+
+```yaml
+- name: Create a folder
+ infisical.vault.create_folder:
+ login_data: "{{ infisical_login.login_data }}"
+ project_id: "{{ project_id }}"
+ env_slug: "dev"
+ path: "/"
+ name: "services"
+ description: "Per-service secrets"
+ register: created_folder
+
+- name: List the folders at the root
+ infisical.vault.read_folders:
+ login_data: "{{ infisical_login.login_data }}"
+ project_id: "{{ project_id }}"
+ env_slug: "dev"
+ path: "/"
+ register: folders
+
+- name: Show the folder names
+ debug:
+ msg: "{{ folders.folders | map(attribute='name') | list }}"
+
+- name: Get a single folder by ID
+ infisical.vault.read_folders:
+ login_data: "{{ infisical_login.login_data }}"
+ folder_id: "{{ created_folder.folder.id }}"
+ register: one_folder
+
+- name: Rename the folder
+ infisical.vault.update_folder:
+ login_data: "{{ infisical_login.login_data }}"
+ project_id: "{{ project_id }}"
+ env_slug: "dev"
+ path: "/"
+ folder_id: "{{ created_folder.folder.id }}"
+ name: "apps"
+
+- name: Delete the folder and everything inside it
+ infisical.vault.delete_folder:
+ login_data: "{{ infisical_login.login_data }}"
+ project_id: "{{ project_id }}"
+ env_slug: "dev"
+ path: "/"
+ folder_id_or_name: "apps"
+ force_delete: true
+```
+
+`read_folders` returns only the direct children of `path`. Set `recursive: true` to list every folder below it instead.
+
+Set `path` to the folder's parent path, not to the folder itself. To rename `/services/backend`, pass `path: "/services"`.
+
+`update_folder` targets a folder only by `folder_id`, never by name, so use `read_folders` to look the ID up first. It also requires `name` on every call, so pass the current name when you only want to change the description. `delete_folder` is more flexible and accepts either an ID or a name through `folder_id_or_name`.
+
+<Warning>
+ Setting `force_delete: true` deletes every secret and subfolder inside the folder along with it.
+</Warning>
+
+#### Reading folders with the lookup plugin
+
+The `read_folders` lookup plugin retrieves folders inline, the same way `read_secrets` does. It returns a plain list rather than the `folders` key the module returns, and returns a one-element list when you pass `folder_id`:
+
+```yaml
+- name: Read folder names with a lookup
+ set_fact:
+ folder_names: "{{ lookup('infisical.vault.read_folders', login_data=infisical_login, project_id='<project-id>', env_slug='dev', path='/') | map(attribute='name') | list }}"
+```
+
### 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](/documentation/platform/dynamic-secrets/overview).
diff --git a/docs/sdks/languages/python.mdx b/docs/sdks/languages/python.mdx
index 515144fff8..32bd2f2612 100644
--- a/docs/sdks/languages/python.mdx
+++ b/docs/sdks/languages/python.mdx
@@ -703,7 +703,11 @@ decrypted_data = client.kms.decrypt_data(
### `folders`
-This sub-class handles operations related to folders:
+This sub-class handles operations related to [folders](/documentation/platform/folder):
+
+<Note>
+ `update_folder` and `delete_folder` require `infisicalsdk` version 1.0.17 or newer.
+</Note>
#### List folders
@@ -761,4 +765,53 @@ folder = client.folders.get_folder_by_id(
- `id` (str): The ID of the folder to retrieve.
**Returns:**
-- `SingleFolderResponseItem`: The response containing the folder details.
\ No newline at end of file
+- `SingleFolderResponseItem`: The response containing the folder details.
+#### Update folder
+
+```python
+updated_folder = client.folders.update_folder(
+ folder_id="<folder-id>",
+ name="backend-api",
+ project_id="<project-id>",
+ environment_slug="dev",
+ path="/", # Optional
+ description="Secrets for the backend service" # Optional
+)
+```
+
+**Parameters:**
+- `folder_id` (str): The ID of the folder to update. Folders can only be updated by ID, so use `list_folders` to look the ID up if you only know the name.
+- `name` (str): The new name of the folder. This is required, so pass the folder's current name to leave it unchanged.
+- `project_id` (str): The ID of your project.
+- `environment_slug` (str): The slug of the environment the folder is in.
+- `path` (str, optional): The parent path the folder is in. Defaults to `/`.
+- `description` (str, optional): A new description for the folder. Omitting it leaves the existing description unchanged, so it cannot be used to clear one.
+
+**Returns:**
+- `UpdateFolderResponseItem`: The response containing the updated folder.
+
+#### Delete folder
+
+```python
+deleted_folder = client.folders.delete_folder(
+ folder_id_or_name="backend",
+ project_id="<project-id>",
+ environment_slug="dev",
+ path="/", # Optional
+ force_delete=False # Optional
+)
+```
+
+**Parameters:**
+- `folder_id_or_name` (str): The ID or the name of the folder to delete.
+- `project_id` (str): The ID of your project.
+- `environment_slug` (str): The slug of the environment the folder is in.
+- `path` (str, optional): The parent path the folder is in. Defaults to `/`.
+- `force_delete` (bool, optional): Whether to delete the folder even when it still contains secrets or subfolders. Defaults to `False`.
+
+<Warning>
+ Setting `force_delete` to `True` removes every secret and subfolder inside the folder along with it.
+</Warning>
+
+**Returns:**
+- `DeleteFolderResponseItem`: The response containing the deleted folder. Unlike the other folder responses, it does not include a `path` field.