On Friday, November 8, 2013 9:06:08 AM UTC-6, giovanni possemato
wrote:>
> Hi all,
>
> i''m making a manifest for an agent on windows.
> I have to make some actions ONLY if a file already exists.
> I tried in this way, but it seems dowsn''t work..
>
> class sql2008{
>
> package { sql2008:
> ensure => present,
> }
>
> exec {''check_dotnet'':
> command => ''IF EXIST
> c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll (echo 1) ELSE
> (echo 0)'',
> returns => $check_dotnet_exist
>
> }
>
> notice(" __ $check_dotnet_exist __ ")
>
> }
>
> When i call the agent, the notice message is "__ __"
> How can i save the output of the exec in a variable?
>
>
You can''t. You can, however, create a custom fact that will contain
the
output generated by your command. The fact will be evaluated before each
Puppet run, so it will be available to all your classes. See
http://docs.puppetlabs.com/guides/custom_facts.html.
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 puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/5f1751f8-c7f8-47fe-ad2b-33fdeadba40e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.