Skip to main content

R/W an ansible-vault yaml file

Project description


Test result badge. Use black.

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

And see wiki.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ansible-vault, version 2.1.0
Filename, size File type Python version Upload date Hashes
Filename, size ansible-vault-2.1.0.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page