Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Group module is not idempotent when gid is specified #29919
From @alvinsw on 2016-01-28T04:43:50Z
OS / ENVIRONMENT
STEPS TO REPRODUCE
First run this command:
Then, running this command:
The opposite, ie repeated commands with same name but different gid, works. I think this is wrong because the gid should have more priority than the name.
Copied from original issue: ansible/ansible-modules-core#2903
From @jctanner on 2016-01-28T04:43:50Z
Tested this across all released ansible versions just to confirm and it was never a behavior of the group module to rename a group by gid. It has always failed with a message similar to "groupadd: GID '3000' already exists". As such, I believe this is a feature request instead of a bug.
From @Yannig on 2016-01-28T04:43:50Z
Cannot reproduce the issue. On my current machine:
What is your OS ?
please advice what could we debug output is here:
I'm having the exact same issue. Adding a group that already exists through the group module results in a failure.
The offending line in the playbook is:
Yeah...I was so focussed on the GID that I never noticed the group name was actually different. So stupid. But it's not a problem with Ansible. Typical PEBKAC.
So an improvement suggestion: In this case, mention the group names are different for the same GID and that's the reason it can't be created :-)