Skip to content

This project aim to R/W an ansible-vault yaml file

License

Notifications You must be signed in to change notification settings

stevebeck89/ansible-vault

 
 

Repository files navigation

ansible-vault

https://travis-ci.org/tomoh1r/ansible-vault.svg?branch=master

This project aim to R/W an ansible-vault yaml file.

This is not Ansible official project.

You can install with pip.

$ pip install ansible-vault

When you have an ansible-vault file, then you can read file. See below.

from ansible_vault import Vault

vault = Vault('password')
data = vault.load(open('vault.yml').read())

When you have to write data, then you can write data to file. See below.

from ansible_vault import Vault

vault = Vault('password')
vault.dump(data, open('vault.yml', 'w'))

# also you can get encrypted text
print(vault.dump(data))

About

This project aim to R/W an ansible-vault yaml file

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%