Table of Contents
About
Simple YAML Generator using local saved JSON template to facilitate and speed up the creation of new vaults within a project.
Technologies
This section covers the tools and packages used for the project,
- NodeJS
-
inquirer
- For interactive shell
-
js-yaml
- To convert the generated JSON to YAML
-
ansible-vault
- To encrypt the strings
Getting Started
Prerequisites
- NodeJS
Installation
npm install -g @yetanothertool/vault
Usage
The template
You can look at tests/vault.json
for a template example.
and the tests/decrypt.yml
contains an example to unvault the values when using the string approach.
Documentation regarding the YAML Format generated: https://docs.ansible.com/ansible/latest/collections/community/aws/aws_ssm_parameter_store_module.html
For Version > 1.3.0:
- Added new option for the templates (
type
) - Support new types with inquirer
- input
- editor
- list
- checkbox
- password
Create new template
This command let you attach a .json
template to an alias.
yat-vault create
Generate vault from template
To prepare the whole file
The data is generated unecrypted, it is up to you to encrypt the whole file.
yat-vault generate
To encrypt the value as string
It uses the ansible-vault
npm package to encrypt each values.
yat-vault generate-string
Passing the vault password with environment variable
export VAULT_PASS="12345"
Contributing
- Create a Feature Branch
- Commit your changes
- Push your changes
- Create a PR
Working with your local branch
Branch Checkout:
git checkout -b <feature|fix|release|chore|hotfix>/prefix-name
Your branch name must starts with [feature|fix|release|chore|hotfix] and use a / before the name; Use hyphens as separator; The prefix correspond to your Kanban tool id (e.g. abc-123)
Keep your branch synced:
git fetch origin
git rebase origin/master
Commit your changes:
git add .
git commit -m "<feat|ci|test|docs|build|chore|style|refactor|perf|BREAKING CHANGE>: commit message"
Follow this convention commitlint for your commit message structure
Push your changes:
git push origin <feature|fix|release|chore|hotfix>/prefix-name
Examples:
git checkout -b release/v1.15.5
git checkout -b feature/abc-123-something-awesome
git checkout -b hotfix/abc-432-something-bad-to-fix
git commit -m "docs: added awesome documentation"
git commit -m "feat: added new feature"
git commit -m "test: added tests"
License
Distributed under the MIT License. See LICENSE for more information.
Contact
- Tommy Gingras @ tommy@studiowebux.com