sous-chefs / users

Development repository for the users cookbook
https://supermarket.chef.io/cookbooks/users
Apache License 2.0
138 stars 217 forks source link

Could I use the users_manage resource on a windows machine? #92

Closed trekr5 closed 8 years ago

trekr5 commented 9 years ago

Hi,

I have a scenario in which all users on the computers in my organization will have their user policy set by the aws-admin-users databag on the Chef server.

This would mean that any user who isn't in the databag would be deleted from a node. I have tested the user_manage resource on a linux node to see if this scenario works and it does however I've found that it doesn't on a windows box.

Is this correct?

Thanks

fabiendelpierre commented 9 years ago

The cookbook does not list Windows as being supported, so I wouldn't expect it to work, correct. You'd think it could work since the cookbook relies on Chef's user resource, which does support Windows through the relevant provider, but it seems the cookbook only addresses the needs of *nix operating systems.

I should think it would be doable to use a bit of Ruby to iterate through your data bag and use the user resource to provision the users that way. If your cookbook is meant to be applied to both Windows and Linux boxes, you can use a bit of additional logic to use the users_manage resource for your Linux nodes, and do things differently and more manually for Windows nodes.

trekr5 commented 9 years ago

Yes,

That is what I ended up doing. I had to write a small ruby script that essentially pulled out the current user list on a windows box, during a Chef run, and compared it to the aws-admin-aws databag on a Chef server and all those users on a windows box that didn't exist in the databag were subsequently deleted.

iennae commented 8 years ago

The current cookbook does not support Windows, and any re-writes won't support Windows in the near to medium future. It sounds like you have identified a working process so I'm going to go ahead and close this issue. Thank you.