I have avery basic playbook which adds 2 users to localhost. Running the playbook with -K works fine but I am trying to make it run by introducing the become variables inside the playbook but it is not working. I tried
become_password = “mypassword”, it did not help. Then I write teh password inside a file in a directory host_vars in the root folder as you can see hereunder did not help neither.
I always get an error of permission denied as playbook was not able to retrieve password or user as follows
“msg”: “useradd: Permission denied.\nuseradd: cannot lock /etc/group; try again later.\n”, “name”: “testuser1”, “rc”: 10}
Sorry jpmens, this is a test environment and trying different ways.
I changed to ansible_become_password in the file but it is not recognized. Reverted back to naming it become_password and creating localhost file in host_vars with only 1 line with the password but it did not help
Both ansible_become_password and become_password are not recognized in the playbook