Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to run a single module like this:

puppet apply --verbose --modulepath=moduleshere --noop -e 'include myclass'

However, I get this kind of error, indicating the path is not set

Parameter unless failed: '[ -e "${logfile}" ]' is not qualified and no path was specified. Please qualify the command or specify a path.

I don't want to explicitly specify the path in every such location, and it works fine when run as part of a full puppet run. How can I specify the path when running a single module?

share|improve this question
add comment

3 Answers

The commands in an Exec resource either have to be fully qualified (i. e. /usr/bin/test instead of test) or the path attribute of that Exec resource has to be set.

If you can modify the Puppet manifest(s) you can simply add the following definition for setting a default path attribute for all Exec resources to /bin:

Exec { path => "/bin" }

As a (more or less) dirty workaround you can also just set the default path for any Exec resource on the command line:

$ puppet apply --verbose -e 'Exec { path => "/bin" }' your_manifest.pp

Documentation pointers:

share|improve this answer
add comment

That.. shouldn't work as part of a full run. It needs a full path to the executable in the unless command. Maybe you've got a path set in a global file that's part of your full runs?

Try unless => '/usr/bin/[ -e "${logfile}" ]', instead.

share|improve this answer
add comment

I agree with Shane that the default path is probably set in a globally scoped manifest. You could do the same but you can't pass it as an argument, so either use stdin:

$ puppet apply -v --modulepath=moduleshere --noop <<EOF
Exec { path => "/bin:/sbin:/usr/bin:/usr/sbin" }
include myclass
EOF

or put the Exec and include lines into example.pp and then use puppet apply -v ... example.pp.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.