About | FAQ | Help
Ask Your Question
0

[Solved] Provider useradd is not functional on this host

asked 2018-05-05 01:22:33 -0500

Hypnoz gravatar image

updated 2018-05-07 03:44:36 -0500

I'm testing out puppet5 on some centos7 hosts. I ran into an error doing a puppet apply:

root@qapuppet5test001.infra:~$ puppet apply -e "user { 'mytest': ensure => present, }"

Notice: Compiled catalog for qapuppet5test001.infra.five9lab.com in environment production in 0.02 seconds
Error: /Stage[main]/Main/User[mytest]: Provider useradd is not functional on this host
Notice: Applied catalog in 0.01 seconds

The useradd program exists and is functional. I also got the same error about "groupadd" which also exists. Any ideas for what to check would be really appreciated since the google search results on this error are so lacking.

edit retag flag offensive close merge delete

Comments

well, I'm not very sure but you can check for the backend provider. How about adding provider attribute in same resource and test it out? Just a thought..

Mr_Sharma gravatar imageMr_Sharma ( 2018-05-05 05:07:54 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-07 03:44:47 -0500

Hypnoz gravatar image

This error happens when the utility it's looking for (useradd in my example) is not on your path. From what I've seen 2 things can cause this:

  1. You didn't run puppet apply or puppet agent as root user.
  2. Somehow your path is getting screwed up during the puppet run.

For me, a custom facter fact was modifying the path, and it removed part of the path with the useradd in it.

Some troubleshooting that helped me figure it out was to go to /opt/puppetlabs/, and make a copy of the "puppet" directory. Then, I went into /opt/puppetlabs/cache/lib/ and did rm -rf *. After that, puppet apply worked, so I knew it's something in that folder. I started slowly removing files until I found which one is causing the issue.

Obviously I have a special case of an improperly formatted facter script, so if someone else comes across this error, just keep in mind that most likely puppet and your system is ok, there is just some problem with your path during the puppet apply not being able to find the files. It's just up to you to find out what is screwing up your path.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-05-05 01:22:33 -0500

Seen: 104 times

Last updated: May 07