Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 1.08 KB

README.md

File metadata and controls

46 lines (28 loc) · 1.08 KB

ansible-vault

This is not Ansible official project.

This project aim to R/W an ansible-vault yaml file. Test result badge. Use black.


Quick Start

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))

Contributing

See CONTRIBUTING.md.


Links