Skip to content

Go package to interact with Ansible Vault files

License

Notifications You must be signed in to change notification settings

sosedoff/ansible-vault-go

Repository files navigation

ansible-vault-go

Go package to read/write Ansible Vault secrets

GoDoc Go Report Card

Installation

go get github.com/sosedoff/ansible-vault-go

Usage

package main

import(
  "log"

  "github.com/sosedoff/ansible-vault-go"
)

func main() {
  // Encrypt secret data
  str, err := vault.Encrypt("secret", "password")

  // Decrypt secret data
  str, err := vault.Decrypt("secret", "password")

  // Write secret data to file
  err := vault.EncryptFile("path/to/secret/file", "secret", "password")

  // Read existing secret
  str, err := vault.DecryptFile("path/to/secret/file", "password")
}

Doc

Check out the Ansible documentation regarding the Vault file format:

License

MIT

About

Go package to interact with Ansible Vault files

Resources

License

Stars

Watchers

Forks

Packages

No packages published