salt icon indicating copy to clipboard operation
salt copied to clipboard

'user.present' on Windows Server 2012 don't create a new user

Open juso opened this issue 13 years ago • 5 comments

user.present doesn't create user on Windows Server 2012.

Interestingly enough, I've seen two different ways saltstack reports the issue. I experiment on a VM installation, so can do a fresh saltstack assisted setup, so originally I got on salt-master the error below:

    State: - user
    Name:      testuser01
    Function:  present
        Result:    False
        Comment:   An exception occurred in this state: Traceback (most recent call last):
    File "salt/state.py", line 1239, in call
    File "salt/states/user.py", line 367, in present
    TypeError: add() got an unexpected keyword argument 'createhome'

And now, after few changes all over the place, on fresh windows installation the salt-master doesn't even report the error, the only trace about attempt to create the user I get from salt-minion logs:

    ...
    2013-08-12 15:56:06,252 [salt.state       ][ERROR   ] No changes made for far
    2013-08-12 15:56:08,748 [salt.state       ][ERROR   ] No changes made for winscp
    2013-08-12 15:56:08,780 [salt.state       ][ERROR   ] No changes made for testuser01
    ...

where the first two entries are not really errors even though reported as ERROR (to my understanding, as those already installed on the box), and the third one states that no changes done to testuser01, and indeed, it wasn't created, which is a problem.

Below are init.sls with regards to user creating

    testuser01:
      user.present:
        - name: testuser01
        - fullname: Test User 01
        - password: ABC123321ABC
        - groups:
          - administrators
Version info:
__c:\salt\salt --versions-report
           Salt: 0.16.2
         Python: 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
         Jinja2: 2.6
       M2Crypto: 0.21.1
 msgpack-python: 0.1.12
   msgpack-pure: Not Installed
       pycrypto: 2.3
         PyYAML: 3.10
          PyZMQ: 13.1.0
            ZMQ: 3.2.2__

juso avatar Aug 12 '13 14:08 juso

I'm sorry for creating the issue in flat text - github formatting really-really sucks, I haven't seen such an archaic formatting of messages for ages. Or is there a service somewhere that can help creating formatted messages automatically?

juso avatar Aug 12 '13 14:08 juso

@juso, thanks for the report and for all the details. That helps a ton. I'll look into this today.

Also, regarding your question about formatting, I edited your original post to allow for some formatting. If you click the edit button you should be able to see how I did it.

UtahDave avatar Aug 12 '13 16:08 UtahDave

@UtahDave - thanx a lot, I see the formatting thingy, will use it in future.

If necessary can give temp access to the box so you debug the issue - it's anyway disposable home lab box. Also, installing now the 0.16.3 windows minion, will see if anything changes.

juso avatar Aug 12 '13 17:08 juso

OK, I just confirmed this issue on Windows Server 2008. I got the exact same error. I'll get this fixed quickly so we can make sure it gets into 0.16.4.

UtahDave avatar Aug 17 '13 22:08 UtahDave

OK, I fixed this bug with #6779.

I looks like there are at least 2 more bugs that surfaced once this one was fixed. I've got a solution for the first regarding setting the password and I still need to figure out the second error.

UtahDave avatar Aug 19 '13 07:08 UtahDave