You can define vault_password_file in ansible.cfg .
But I do not see in it too much value. Looking at the .netrc man page, I see that the credentials are in the .netrc file and also written in clear text. In addition, he offers:
This file is located in the user's home directory on the computer initiating the file transfer. Its permissions must be configured to restrict read access to groups and others.
For .netrc, this makes sense, because the goal is to provide access to other systems. But your goal is to provide access to the file.
Although it doesnβt make much sense to encrypt a file, then just put the decryption key inside another file on the same host that is protected only by chmod . You could simply protect your secrets in Ansible with chmod in the first place. This has the same level of security and avoids some overhead.
source share