Ansible user creation task - validation issue

Hi @Inderpreet @KodeKloud @rahul456 // Comments from anyone else is also welcomed

Could you please validate my work for this task.

I have done all the tasks correctly, still validation shows as Failed.

I’m even able to login as ‘rob’ user, sharing you a screenshot.


Hi @ramashish.sharma could you brief me what was the task?

This is the question:

If it is able to login then I guess I need to see the playbook if u did anything wrong there or how have you used vault file, also did you set password for admins group users which was originally for developers or vice versa?

Hi Akshay,

I dont have the screenshot of my .yml file. But i can say the method used is:

First I have kept the password in a separate file using :

ansible-vault create creds.yml

and updated that file in “vars_file” section.

Then i have used below method to hash the password.

password: "{{ develops | password_hash('sha512') }}"

My playbook ran without errors and I’m sure everything went fine. I have even validated what you said like gave wrong password for admin/developer or vice-versa…

Just to add i have also updated the ansible.cfg in current directory to point to vault_password_file as given in the question.

Not sure but I guess by doing :
ansible-vault create creds.yml
You made creds.yml your vault file you had to do instead:
ansible-vault encrypt creds.yml --vault-password-file=vault.txt
which you have already mentioned in ansible.cfg .
just had encrypt the newly created file , but just as I said not fully sure if this is the issue.


There are 2 ways by which we can do it.

First method either use command line as you said:

ansible-vault encrypt creds.yml --vault-password-file=vault.txt

Second method is to use vault password by updating it in ansible.cfg file and use above command without passing --vault…

In this scenario, as per question they have asked us to update it in ansible.cfg which i did and it worked as expected. I can see the passwords were encrypted and those were again hashed in playbook.

Moreover, I see another discussion on the same topic, where another user @ mouador had the same issue and he mentioned there is some validation issue.

Excerpt from that discussion:

Hello @Inderpreet,
The issue was in the validation section (it runs with the default ansible config /etc/ansible/ansible.cfg), that’s why it cause the prb,
Now I’m facing another issue, it tells me that the password of the user rob is incorrect

That task takes from me the third place in the leaderboard and I did’nt get my daily task so I felt twice
and I hope to regenerate another task for us if it possible
Best regards,

@Inderpreet @rahul456,

Request you to have a look at my logs, I’m sure the method i used was correct and i validated too when i got the error the ‘rob’ is not able to login. I logged into stapp03 server as rob and he was able to login.

1 Like

Oh, okay! thanks for the info! :grinning:

Hi @Inderpreet @KodeKloud @rahul456

Can someone have a look and update me.

Ramashish Sharma

Don’t worry @ramashish.sharma. KKE team will look. At least provide us a time.

hi @ramashish.sharma, sorry the issue, this is marked success for you.

Thank you @rahul456 for looking into this and correcting the issue.