Is it acceptable to put `ansible_ssh_pass` or `ansible_become_password` in inventory?
BeginnerProductionSecurity and Secrets
Answer
Not in plain text. If you must use passwords, store them in a vaulted file and reference them (ansible_become_password: "{{ vault_become_password }}") or provide them through AWX credentials. Better still, remove passwords from the design: SSH keys or certificates for login and passwordless sudo for the automation user (with the other controls from this section).
Plain-text passwords in inventory also leak through ansible-inventory --list and AWX inventory exports.
More on Security and Secrets
How do you set up a secure automation user and SSH access?BeginnerHow do you give the automation user sudo with least privilege?IntermediateWhat are the alternatives to Ansible Vault for secrets, and when do you use them?IntermediateHow do you read AWS Secrets Manager and SSM parameters in a playbook?IntermediateHow do you integrate HashiCorp Vault with Ansible?AdvancedHow do you stop secrets from leaking into logs and output?Beginner