Help with securing password

Hi,

Can someone help me with the below please?

I have a role with the following task in

roles/passwd/tasks/main.yml

  • name: Change user1 password
    user: name=user1 update_password=always password={{ user1_password }}

I have this variable in my group vars

inventories/reporting/all.yml

user1_password: “{{ ‘user1passwd’ | password_hash(‘sha512’) }}”

  1. The task runs without issue but if I try to login with user1 and user1passwd it does not work

  2. I want to move the var out of all.yml and into a vault but I am not sure how ansible will find the password if its not in all.yml?

Thanks,

Phil

Can you provide more details on the “does not work” when you login. If the playbook does report that it changed it (or on the second run reports “ok”), then as far as Ansible can tell it’s set. There might be something on your system denying the login.

On my Fedora 28 workstation with Ansible 2.6.1 this playbook called “pwd.yml”: