Skip to content
Advertisement

Can’t assign password to user with ansible user module

JavaScript

When I run this it does what it’s supposed to do. It creates the user and the home directory that I specify. It also prints out a password and the hash but I can’t log change to this user no matter what I do.

Any suggestions on how I can get a password assigned to this user correctly would be much appreciated.

Advertisement

Answer

The problem is that pwd_alias, when put into the vars, will be evaluated each time referenced. For example the play below

JavaScript

gives

JavaScript

The solution is simple. Put the evaluation of pwd_alias into the tasks. For example

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement