-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Prevent user.present to change uid and gid of existing user #43208
Comments
@mitar can you clarify your use case a little more. Can you share the state your using? Just need to clarify if you have set a UID/GID in your state or not? in other words Is it changing the UID of a user without even declaring a UID in the state? |
No, I have an explicit state with uid:
I am currently using
|
I too have troubles with
User and/or group may already exist.
I am asking for any workaround at users formula issue. |
@gtmanfred are you aware of some general issues with user/group present/absent ? |
@noelmcloughlin your issue seems to be unrelated to this issue. Would you mind opening a new one? Back to the original issue: I would say that this would be considered expected behavior since as an admin you can change the uid/gid of user as well, but i want to ping @terminalmage here as well to see if he agrees. Or maybe we can add an option possibly that ensures we don't change the gid/uid if user changes it in the state. |
@Ch3LL I think it's a good idea to gate a change like this behind an argument. |
#46502 fixes this, PR message includes a docker container to confirm the new behavior, and new unit tests have been added. |
Description of Issue/Question
I would prefer if
user.present
would throw an error instead of trying to change uid and gid of an existing user. Currently, if an user already exists, it changes uid and gid values to new values. This might leave some files on the system previously belonging to the user with old permissions.Versions Report
The text was updated successfully, but these errors were encountered: