User resource for ldap enabled server

asked 2017-09-19 14:44:45 -0500

kumaresang gravatar image

I have to create a local user. I have a user resource module but that's not working as the LDAP service is running. I have to stop the nscd and nslcd before creating the user.

I tried with before=>'Service ['nscd'] but thats conflicting as thats already mentioned in another module to configure ldap client.

I too tried with Exec command => '/sbin/service nscd stop ; /sbin/service nslcd stop' but its not working either.

Do you have any better solution to create local user for LDAP enabled servers?

edit retag flag offensive close merge delete

Comments

Are you using the `user` resource https://docs.puppet.com/puppet/latest/types/user.html#user-description, are you not?

Kai Burghardt gravatar imageKai Burghardt ( 2017-09-19 16:43:16 -0500 )edit

This reminds me of a problem we had with a NIS client. Maybe try using file_line from stdlib and pointing it directly at your passwd and shadow files. Not ideal, but it should work. You might be able to test nsswitch.conf with files first, but I think you'll need a file_line type solution.

luksi1 gravatar imageluksi1 ( 2017-09-26 13:21:29 -0500 )edit