[![PyPi](https://img.shields.io/pypi/v/otf-addons-vault.svg)](https://pypi.org/project/otf-addons-vault/)
![unittest status](https://github.com/adammcdonagh/otf-addons-vault/actions/workflows/test.yml/badge.svg)
[![Coverage](https://img.shields.io/codecov/c/github/adammcdonagh/otf-addons-vault.svg)](https://codecov.io/gh/adammcdonagh/otf-addons-vault)
[![License](https://img.shields.io/github/license/adammcdonagh/otf-addons-vault.svg)](https://github.com/adammcdonagh/otf-addons-vault/blob/master/LICENSE)
[![Issues](https://img.shields.io/github/issues/adammcdonagh/otf-addons-vault.svg)](https://github.com/adammcdonagh/otf-addons-vault/issues)
[![Stars](https://img.shields.io/github/stars/adammcdonagh/otf-addons-vault.svg)](https://github.com/adammcdonagh/otf-addons-vault/stargazers)
This repository contains a variable lookup plugins for [Open Task Framework (OTF)](https://github.com/adammcdonagh/open-task-framework) to pull dynamic variables from HashiCorp Vault.
Open Task Framework (OTF) is a Python based framework to make it easy to run predefined file transfers and scripts/commands on remote machines.
# Vault Variables
This package uses `hvac` to communicate with Vault.
Credentials can be set via config using specific named variables alongside the protocol definition, or by using environment variables e.g;
```json
"protocol": {
"name": "local",
"VAULT_ADDR": "https://vault.example.com:8200",
"VAULT_TOKEN": "some_token"
}
```
If these variables are set in the environment, then these will be used if not set elsewhere.
# Vault KV Secrets Engine Version
The default version is v1. This can be overridden by setting the environment variable `VAULT_API_VER` to `v2` (or specifying the variable manually)
# Variable Lookup
Variables can be looked up using the `vault` plugin. This is done using standard Jinja2 syntax e.g;
```json
{
"name": "my_task",
"variables": {
"my_variable": "{{ vault('secret/data/my_secret', key='my_key') }}"
}
}
```
If not supplied using the `attribute` argument, the default key is `value`. If the key does not exist, the plugin will return an error.
```json
{
"name": "my_task",
"variables": {
"my_variable": "{{ vault('secret/data/my_secret', key='some_key', attribute='password') }}"
}
}
```
Raw data
{
"_id": null,
"home_page": null,
"name": "otf-addons-vault",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "automation, task, framework, hashicorp, vault, secrets, otf",
"author": null,
"author_email": "Adam McDonagh <adam@elitemonkey.net>",
"download_url": "https://files.pythonhosted.org/packages/e2/68/356c1126f33420390fca22a8611dea722fe27d09aa36f558fdef469279d1/otf_addons_vault-24.18.3.tar.gz",
"platform": null,
"description": "[![PyPi](https://img.shields.io/pypi/v/otf-addons-vault.svg)](https://pypi.org/project/otf-addons-vault/)\n![unittest status](https://github.com/adammcdonagh/otf-addons-vault/actions/workflows/test.yml/badge.svg)\n[![Coverage](https://img.shields.io/codecov/c/github/adammcdonagh/otf-addons-vault.svg)](https://codecov.io/gh/adammcdonagh/otf-addons-vault)\n[![License](https://img.shields.io/github/license/adammcdonagh/otf-addons-vault.svg)](https://github.com/adammcdonagh/otf-addons-vault/blob/master/LICENSE)\n[![Issues](https://img.shields.io/github/issues/adammcdonagh/otf-addons-vault.svg)](https://github.com/adammcdonagh/otf-addons-vault/issues)\n[![Stars](https://img.shields.io/github/stars/adammcdonagh/otf-addons-vault.svg)](https://github.com/adammcdonagh/otf-addons-vault/stargazers)\n\nThis repository contains a variable lookup plugins for [Open Task Framework (OTF)](https://github.com/adammcdonagh/open-task-framework) to pull dynamic variables from HashiCorp Vault.\n\nOpen Task Framework (OTF) is a Python based framework to make it easy to run predefined file transfers and scripts/commands on remote machines.\n\n# Vault Variables\n\nThis package uses `hvac` to communicate with Vault.\n\nCredentials can be set via config using specific named variables alongside the protocol definition, or by using environment variables e.g;\n\n```json\n\"protocol\": {\n \"name\": \"local\",\n \"VAULT_ADDR\": \"https://vault.example.com:8200\",\n \"VAULT_TOKEN\": \"some_token\"\n}\n```\n\nIf these variables are set in the environment, then these will be used if not set elsewhere.\n\n# Vault KV Secrets Engine Version\n\nThe default version is v1. This can be overridden by setting the environment variable `VAULT_API_VER` to `v2` (or specifying the variable manually)\n\n# Variable Lookup\n\nVariables can be looked up using the `vault` plugin. This is done using standard Jinja2 syntax e.g;\n\n```json\n{\n \"name\": \"my_task\",\n \"variables\": {\n \"my_variable\": \"{{ vault('secret/data/my_secret', key='my_key') }}\"\n }\n}\n```\n\nIf not supplied using the `attribute` argument, the default key is `value`. If the key does not exist, the plugin will return an error.\n\n```json\n{\n \"name\": \"my_task\",\n \"variables\": {\n \"my_variable\": \"{{ vault('secret/data/my_secret', key='some_key', attribute='password') }}\"\n }\n}\n```\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "Addons for opentaskpy, giving it the ability to read variables from Hashicorp Vault",
"version": "24.18.3",
"project_urls": {
"Bug Tracker": "https://github.com/adammcdonagh/otf-addons-vault/issues",
"Changelog": "https://github.com/adammcdonagh/otf-addons-vault/blob/main/CHANGELOG.md",
"Homepage": "https://github.com/adammcdonagh/otf-addons-vault"
},
"split_keywords": [
"automation",
" task",
" framework",
" hashicorp",
" vault",
" secrets",
" otf"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e268356c1126f33420390fca22a8611dea722fe27d09aa36f558fdef469279d1",
"md5": "12f90a3b9aacd45b730616589126b883",
"sha256": "43f4754f84963322cb2c964b9f32549066fe110621175463cbd952f2930ade3c"
},
"downloads": -1,
"filename": "otf_addons_vault-24.18.3.tar.gz",
"has_sig": false,
"md5_digest": "12f90a3b9aacd45b730616589126b883",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 23037,
"upload_time": "2024-05-05T16:13:24",
"upload_time_iso_8601": "2024-05-05T16:13:24.662512Z",
"url": "https://files.pythonhosted.org/packages/e2/68/356c1126f33420390fca22a8611dea722fe27d09aa36f558fdef469279d1/otf_addons_vault-24.18.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-05 16:13:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "adammcdonagh",
"github_project": "otf-addons-vault",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "otf-addons-vault"
}