On Friday, February 7, 2014 5:16:57 AM UTC-6, [email protected] wrote:
>
> Hi,
> I need to use an exec resource to execute a shell script, and I'd like to 
> keep the script on the puppet master.
>
> Is there a way to make the exec resource execute the script directly from 
> puppet's built-in file server? It doesn't seem to accept the puppet:/// URI 
> type.
>


No, of course not.  The 'command' property of an Exec (or its title if you 
don't specify the 'command' as a separate parameter) is a literal command 
such as you would issue from a shell.  Shells don't do URIs.

 

>
> Otherwise I will need to copy it locally on the client and execute it from 
> there (and maybe delete it afterwards).
>
>

That is a viable option.  Alternatively, on a POSIX system such as Linux, 
you could also do something like this:

exec { 'myscript':
  command => file('/path/to/script'),
  provider => 'shell'
} 

where /path/to/script is the location of your script *on the master*.  That 
includes the full content of the script directly in the catalog, bypassing 
Puppet's file server.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9dee8817-d45c-47d9-ae51-9e76b5a99b15%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to