Ansible Vault is an excellent tool for encrypting sensitive data

There are sensitive data that a playbook needs to operate on, be that for playbook data in the form of variables or storing server credentials themselves, such as an SSH private key.

Comments