On Mon, Oct 12, 2015 at 8:09 AM, Leroy Tennison <[email protected]>
wrote:
> Thanks for the replies, learned more than I imagined.
>
> On Friday, October 9, 2015 at 2:53:47 PM UTC-5, Leroy Tennison wrote:
>>
>> Puppet v3.4.3
>>
>> What I was specifically hoping to do was:
>>
>> exec { 'test' :
>>
>> command => "%comspec% /c (a Windows command-line program with
>> parameters)",
>>
>> }
>>
>>
>> to avoid having to determine where Windows was installed.
>>
>
One useful trick on Windows is to set the `path` parameter of the exec
resource to the value of the `path` fact so that you don't have to know
where Windows was installed:
exec { 'test':
command => "cmd.exe /c echo hello",
path => $path
}
It does assume you trust the `path` fact. For example, a user less
privileged than puppet shouldn't be able to manipulate the system in a way
that causes the `path` fact to contain user specified directories.
Although 'puppet parser vaildate init.pp' doesn't return an error the
>> client agent reports "...not qualified and no path was specified... " (I
>> realize the parser doesn't catch everything)
>>
>> I tried variants %%comspec%% and \%comspec\% (puppet parser complained
>> about this) but nothing works. If this is possible please provide an
>> example of the correct syntax, thanks.
>>
>> Now for the more general question, are environment variables defined on
>> Windows able to be used at all on the puppet server when specifying an
>> agent action?
>>
> --
> 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/d3526938-7e72-475b-890f-6600108136ad%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/d3526938-7e72-475b-890f-6600108136ad%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
Josh
--
Josh Cooper
Developer, Puppet Labs
--
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/CA%2Bu97ukcRywu-M3qNwPxvhVyGcwsPULGVH5eBX3jKd6%2BkWfD8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.