How Do You Troubleshoot an Ansible Error about a User Not Being Able to Authenticate when the Module is Supposed to Interact with a Database?

Problem scenario
You have an Ansible module that uses a database module.  When you run the playbook, you get an error about a user being unable to authenticate when this database module is run.  What could be wrong?

Solution
Is the user in the error message a user that is created via the playbook?  If it is, does that user get assigned a password?  The password must not be clear text.  Here is an example of an incorrect attribute for the password attribute:

password:  "verygoodpassword"

You must use a hashed password.  It would look something like this:

password:  "$j3/$j4.afjeroi48e89ksdaefqasfijklr/xk3.asdfklir"

To obtain this hashed password (and know what the value actually is beforehand), follow these instructions.

Leave a comment

Your email address will not be published.