-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding user with user module fails on RHEL7 #22576
Comments
why is it osr-ansible instead of ansible user to be created? |
Sorry, changed the name in play snippet for simplicities sake, adjusting back |
I ran 2 plays and got the desired result. Seems like the bug is in trying to set the group when creating a user. - name: Create osr-ansible user
user:
name: osr-ansible
# group: osr-ansible
- name: Update user osr-ansible groups
user:
name: osr-ansible
groups: osr-ansible,adm,wheel
append: yes |
@jwfuller You do not need "osr-ansible" in the "groups" list in the second task — it is the user's primary group already. |
Thanks @oleyka. I think I have this sorted. If I switch from RHEL creates private groups by default, so I was being redundant in my config. I am going to close this since I don't think it is a real bug. |
I actually think it is a real bug. I can get the desired results when I run ansible==2.0.2.0 but not with ansible==2.3.0.0. I know we're lagging behind in our version, but I can tell you something was introduced that makes this:
go from a successful run in RHEL 7 to a failed run.
|
Having the same issue with RHEL 7 and Ansible 2.2.0 and 2.2.1, error message as above
|
The same issue on ansible 2.2.1.0, target host is on Red Hat Enterprise Linux Server release 6.7 (Santiago)
|
In my case, the problem is that the user is under IPA management, not local user. If I remove "home: /home/prometheus," it seems working ok. |
Updating for a target machine of CentOS 6.5 x64 bit and Ansible 2.3.1.0:
became
|
I encountered this as well. While it may not be technically a bug, it is certainly counter-intuitive. |
From what I learned Ansible calls useradd and usermod in random order, so if your user has any other extra attributes e.g. comment or home, it is likely to fail. |
People experiencing this problem are probably running the
In the above example, you can see both that (a) You can avoid this problem by explicitly flushing the
|
My situation has this same problem but for a slightly different reason. We don't permit password changes/updates from the end machine - we have an identity management system that pushes the changes into LDAP. I can run the
Along with this error is this message from
We have both LDAP and stand-alone systems this playbook could be run against, so dropping the If anyone has a better idea on handling both cases I'm all ears. |
ISSUE TYPE
COMPONENT NAME
user
ANSIBLE VERSION
CONFIGURATION
Default
OS / ENVIRONMENT
I think N/A but OSX 10.11.6
SUMMARY
Cannot create a user on RHEL 7. See also ansible/ansible-modules-core#4238
STEPS TO REPRODUCE
When running the following on a RHEL7 target
EXPECTED RESULTS
User should have been created
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: