Skip to main content

R/W an ansible-vault yaml file

Project description

https://github.com/tomoh1r/ansible-vault/workflows/test/badge.svg https://img.shields.io/badge/code%20style-black-000000.svg

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

Project details


Download files

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

Source Distribution

ansible-vault-2.0.0.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file ansible-vault-2.0.0.tar.gz.

File metadata

  • Download URL: ansible-vault-2.0.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

File hashes

Hashes for ansible-vault-2.0.0.tar.gz
Algorithm Hash digest
SHA256 ffe7afa481be88eb8415ede37fba203695c04bb415208cd13aff509a82e7dffa
MD5 6bb916c6896f54d7e11ff4db1ea2db2c
BLAKE2b-256 93e904103f3efd6532f745eef2fff6f4d52042a7f9ad4c46256bc7e708e398aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page