Thanks Felix. I do want it to fire all the time, and I will add
"noop=false" to be explicit.

but it does not look safe as the $content could contain single quotes,
could it not?

> $content = inline_template(...)
>
> exec { "generate_facts_yaml":
>        command => "/bin/false",
>        unless => "echo '$content' > /path/to/file",
> }


On Thu, Mar 31, 2011 at 9:34 AM, Felix Frank
<[email protected]> wrote:
>> someone also suggested I used an Exec resource like so:
>>
>> exec { "generate_facts_yaml":
>>         command => "/bin/false",
>>         unless => "do the real work here",
>>     }
>>
>> Can I generate a file's content, from an inline template, in an Exec
>> like above? How can I do that?
>
> Bah, that's an ugly hack.
>
> You might want to try:
>
> $content = inline_template(...)
>
> exec { "generate_facts_yaml":
>        command => "/bin/false",
>        unless => "echo '$content' > /path/to/file",
> }
>
> Note that despite never logging anything, this *will* fire on each
> catalog run. It's bound to disturb whoever else needs to maintain your
> manifests. Don't do it if you can avoid it in any possible way.
>
> Cheers,
> Felix
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to