user module doesn't work properly

28 views
Skip to first unread message

Koji Tanaka

unread,
Oct 20, 2015, 4:43:44 PM10/20/15
to Ansible Project
Hello Ansible Community,

I have a task described below, and it works fine if the user account has been managed by Ansible since the moment of the user account creation. However, this task always ends with "changed" status when I try to manage an existing user account on an existing server. Has anyone seen the same issue? Or could it be something local to my server? The OS is RHEL 6.7, and the Ansible version is 1.9.4.

- name: create user myuser
  user:
    name: myuser
    comment: my test user
    home: /home/myuser
    uid: 12345
    groups: users
    password: encrypted_password
    update_password: on_create

Thank you,
Koji

Jean-Yves LENHOF

unread,
Oct 21, 2015, 5:49:27 AM10/21/15
to ansible...@googlegroups.com, Koji Tanaka
Hi,

Why did you use groups when you have only one group ?
I think you should use "group" instead of "groups"

This is this issue
https://github.com/ansible/ansible-modules-core/issues/1118
A part of the problem is when you put your main group in the groups
(with a s) list

Regards,

Koji Tanaka

unread,
Oct 21, 2015, 11:04:07 AM10/21/15
to Jean-Yves LENHOF, ansible...@googlegroups.com
Thank you so much, Jean-Yves. That's exactly the issue I had. I used
"groups" because the first user account I tried to maintain had
multiple groups to belong to, and I ignorantly copied and pasted it
without caring much about the "s".

Now I know what's behind. Thanks so much again!

Bests,
Koji
Reply all
Reply to author
Forward
0 new messages