Skip to the content.

terraform-provider-ansiblevault

Build Status codecov Go Report Card

This Terraform provider allows you to access secrets from an Ansible Vault from Terraform.

Made with ❤️ by Meilleurs Agents

Thanks

Thanks to ansible-vault-go repository for having done the hardest part.

Installation

Terraform 0.13

This provider is available in terraform registry.

For local development follow https://developer.hashicorp.com/terraform/plugin/debugging#terraform-cli-development-overrides

Terrform 0.12

curl https://raw.githubusercontent.com/MeilleursAgents/terraform-provider-ansiblevault/master/install.sh | bash

Usage

ansiblevault_path example:


provider "ansiblevault" {
  vault_path  = "/home/username/.vault_pass.txt"
  root_folder = "/home/username/infra/ansible/"
}

data "ansiblevault_path" "api_key" {
  path = "./passwords.yml"
  key = "USER_PASSWORD"
}

${data.ansiblevault_path.api_key.value} will contain value of `USER_PASSWORD` stored in "/home/username/infra/ansible/passwords.yml"

More examples in : examples/terraform/

Using the provider

Master

Latest publish version

Contribution

You have to enable Go modules for compiling this project.

Git hooks are availables for avoiding mistakes and ensure code quality, you can install them with:

make config

Build and Deploy

You need a Github OAuth Token for doing a GitHub release and goreleaser

make github

License

This project is licensed under the MIT license (see LICENSE file).

FOSSA Status

Reading

Motivation behind this provider is decribe here