Skip to content

Tag: ansible

Can’t assign password to user with ansible user module

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

Iterating Ansible setup command

I want to use ansible setup module to retrieve hosts specs and I tried with a bash for loop. Ansible version: 2.4 My hosts inventory has been defined in a group of machines which I called rhelmachines I would like to collect the following list of variables called “specs” I am then trying to includ…

How to remove temp file in ansible using copy module

I’m using adhoc command for example After copy in the remote host. I found temp files in the directory ~/.ansible/tmp How to remove this temp directory on remote host? Using another module like “commmand” ? In the reference of copy ansible module i did not found about remove temp file after …

Using register with a loop in Ansible

i want to code a playbook which IF a user exists changes the pw of it. The playbook should be able to take n User’s and change the pw of those Users. At the moment im having the issue that the when is empty due to the loop, i tried using with_items: {{ user_exists.results }} but this is somehow not