The UserX:  variable portion wasn't used so I've removed it...
 

> Ops:
>  - uname: user1
>
   passwd: ValidHash
>
 - uname: user2
>    passwd: ValidHash
>
>
Then your tasks would be something like this...

- user: name={{ item.uname }} state=present update_password=on_create 
password={{ item.password }} createhome=yes
  with_items: Ops

- file: path=/home/{{ item.uname }}/.ssh state=directory mode=0700 
owner={{item.uname}}
  with_items: Ops

I'm not sure what files you would want to copy... You might prefer to use 
generate_ssh_key in the user task and then copy an authorized key using 
authorized_key...    I'm not entirely sure which fits best with what you 
want...

Your problem earlier was that register will create folder_exists...  And 
you probably shouldn't be using shell actions for things that real modules 
exist for.  Shell is not idempotent, but the other modules are.  So if they 
don't need to do anything they won't.

Adam


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/14a2cd47-558d-4421-8596-9c8b93fcb18a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to