2Modules6Plugins1Dependency
An Ansible Collection for managing HashiCorp Vault.
This repository contains the hashicorp.vault
Ansible Collection.
The primary purpose of this collection is to provide seamless integration between Ansible Automation Platform and HashiCorp Vault. It contains modules and plugins that support managing secrets, namespaces, authentication, and other Vault operations by using Ansible automation.
Some modules and plugins require external libraries. Please check the requirements for each plugin or module you use in the documentation to find out which requirements are needed.
Tested with the Ansible Core >= 2.16.0 versions.
Tested with the Python >= 3.10 versions.
Name | Description |
---|---|
hashicorp.vault.kv2_secret_get | Look up KV2 secrets stored in Hasicorp vault |
Name | Description |
---|---|
hashicorp.vault.kv2_secret | Manage HashiCorp Vault KV version 2 secrets |
hashicorp.vault.kv2_secret_info | Read HashiCorp Vault KV version 2 secrets |
To install this collection from Automation Hub, the following needs to be added to ansible.cfg
:
[galaxy]
server_list=automation_hub
[galaxy_server.automation_hub]
url=https://console.redhat.com/api/automation-hub/content/published/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=<SuperSecretToken>
To download contents from Automation Hub using ansible-galaxy
CLI, you would need to generate and use an offline token.
If you already have a token, please ensure that it has not expired. Visit Connect to Hub to obtain the necessary token.
With this configured and Ansible Galaxy command-line tool installed, run the following command:
ansible-galaxy collection install hashicorp.vault
You can also include it in a requirements.yml
file and install it via ansible-galaxy collection install -r requirements.yml
using the format:
collections:
- name: hashicorp.vault
To upgrade the collection to the latest available version, run the following command:
ansible-galaxy collection install hashicorp.vault --upgrade
You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax where X.Y.Z
can be any available version:
ansible-galaxy collection install hashicorp.vault:==X.Y.Z
See Ansible Using Collections for more details.
Modules in this collection can be used for various operations on HashiCorp Vault. Currently the collection supports: - Managing KV2 secrets in HashiCorp Vault (create, read, update, delete [soft-delete])
GitHub Actions workflows are used to run tests for the hashicorp.vault collection. These workflows include jobs to run the unit tests, integration tests, sanity tests, linters, changelog check and doc related checks.
To run linter tests locally, run tox -e linters
. For more information, refer tox-ansible documentation.
To run integration tests locally, copy tests/integration/integration_config.yml.template to tests/integration/integration_config.yml, fill in your Vault details and run the tests using ansible-test integration <target>
---
vault_url_from_int_config: "<VAULT_URL_HERE>"
vault_namespace_from_int_config: "<VAULT_NAMESPACE_HERE>" # example: admin/hashicorp-vault-integration-tests
vault_approle_role_id_from_int_config: "<VAULT_APPROLE_ROLE_ID_HERE>"
vault_approle_secret_id_from_int_config: "<VAULT_APPROLE_SECRET_ID_HERE>"
As Red Hat Ansible Certified Content, this collection is entitled to support through the Ansible Automation Platform (AAP) using the Create issue button on the top right corner. If a support case cannot be opened with Red Hat and the collection has been obtained either from Galaxy or GitHub, there may be community help available on the Ansible Forum.
See the changelog.
GNU General Public License v3.0 or later.
See LICENSE to see the full text.
Product |
---|
Red Hat Ansible Automation Platform 2.4 |
Red Hat Ansible Automation Platform 2.5 |
This collection requires the following collections for use:
Name | Summary |
---|
The Red Hat Ecosystem Catalog is the official source for discovering and learning more about the Red Hat Ecosystem of both Red Hat and certified third-party products and services.
We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.