Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

User module makes changes in check mode on OS X #2956

Closed
mattclay opened this issue Feb 4, 2016 · 2 comments · Fixed by #2995
Closed

User module makes changes in check mode on OS X #2956

mattclay opened this issue Feb 4, 2016 · 2 comments · Fixed by #2995
Assignees
Milestone

Comments

@mattclay
Copy link
Member

mattclay commented Feb 4, 2016

Issue Type:

Bug Report

Ansible Version:
ansible 2.1.0 (devel 699a854bf3) last updated 2016/02/03 23:35:36 (GMT -700)
  lib/ansible/modules/core: (detached HEAD 93d02189f6) last updated 2016/02/02 23:37:28 (GMT -700)
  lib/ansible/modules/extras: (detached HEAD fff5ae6994) last updated 2016/02/02 23:37:31 (GMT -700)
  config file =
  configured module search path = Default w/o overrides
Ansible Configuration:

N/A

Environment:

OS X 10.10.5 (Yosemite)

Summary:

The user module makes changes to users, such as changing the UID, in check mode.

Steps To Reproduce:

Assuming a user test1 already exists with a UID other than 3333:

dscl . -read /Users/test1 UniqueID
ansible localhost -m user -a 'user=test1 uid=3333' --check
dscl . -read /Users/test1 UniqueID
Expected Results:

No changes should be made.

Actual Results:

The UID of the user is changed:

sh-3.2# dscl . -read /Users/test1 UniqueID
UniqueID: 9999
sh-3.2# ansible localhost -m user -a 'user=test1 uid=3333' --check
localhost | SUCCESS => {
    "append": false,
    "changed": true,
    "comment": "",
    "group": 4294967295,
    "home": "/Users/test1",
    "move_home": false,
    "name": "test1",
    "shell": "/usr/bin/false",
    "state": "present",
    "uid": 3333
}
sh-3.2# dscl . -read /Users/test1 UniqueID
UniqueID: 3333
@mattclay
Copy link
Member Author

mattclay commented Feb 4, 2016

The user module will also set the password in check mode.

@mattclay
Copy link
Member Author

mattclay commented Feb 4, 2016

It also adds and removes groups, as well as changing users to be hidden/not hidden.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants