ansible user module

ok I have been working with the user module for the last week. I really want to like ansible because it does not have any additional client requirements except ssh. The problem I am having is that I am getting inconsistent results when using the user module.

I add in the user to the play, and most of the time if I add a new user it will create it, but if I change the comment, or password, or shell or anything like that it is very unpredictable if it actually works, but it most likely will not work and will just give me the
: ok=2 changed=0 unreachable=0 failed=0
for all servers after a change was made to a play.

Example play file

What OS are you targetting and what ansible version are you using?

I am using ansible 1.5.5. The server/clients are centos 6.5 and RHEL 6.5

You cannot specify multiple user entries under the one name. You need to modify it to do the following:

  • name: add user1
    user: …
  • name: add user2
    user: …

See also “with_items” …

That is not the issue, the issue is that I am getting inconsistent results, and ansible is not changing the client after I change the playbook. If some one is able to point out something in my playbook that I am doing wrong I can deal with that, but as far as I can tell I am setting it up correctly, but ansible is just missing when I make changes which is very scary problem to have.

James already pointed out your issue (at least one of them)…
it should be :-

I thought James was just showing a different way of setting up the playbook. Yes this fixes my issue. Thank you very much for helping out with my problem. The playbook appears to be working properly now.