# Ansible vault encrypt/decrypt ## Encrypt Echo passwords through `ansible-vault` into a file. Provide encryption password when prompted (can be different for each password) ```shell printf "%s" | ansible-vault encrypt_string --stdin-name= > .var.yml printf "%s" | ansible-vault encrypt_string --stdin-name= >> .var.yml ... ``` ## Decrypt Retrieve a single decrytped password from password file. Provide encryption password when prompted. ```shell ansible localhost -e '@.var.yml' --ask-vault-pass -m debug -a 'var=' ```