On 12/14/2011 11:16 AM, Martin Alfke wrote: > Here you subscribe to the exec resource. > Exec resource will get parsed but the command will not run > What you want is > require => Exec[...]
No. Subscribe creates a notification for the subscribing resource if the subscribed resource needs a change, e.g. an exec is run. However, file resources are *always* evaluated, whether notified or not. The only way to do what the OP wants is to use 'exec { "cp ...": refreshonly => true }' instead of file { }. Exec is one of the few types that can be controlled with subscriptions/notifications. However, that would be poor design. I'd suggest writing a simple wrapper script to do all that needs doing and have exec {} call that script instead. Failing that, put all your commands in variables and exec { "$cmd1 && $cmd2 && $cmd3 ...": ... }. But that's no quite best practice, either. HTH, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.