Thanks! That is exactly I need!
вторник, 19 ноября 2013 г., 20:12:36 UTC+9 пользователь Justin Lambert
написал:
>
> If you're trying to run an exec, you can do this:
>
> file { '/tmp/test':
> ensure => present,
> content => 'Hello',
> notify => Exec['after'],
> }
>
> exec { 'after':
> command => '/bin/echo Created',
> refreshonly => true,
> }
>
> subscribe on the exec vs notify on the file works as well as does the
> chaining arrow. To me, notify is easier to read but you can mix and match
> as well. I think the refreshonly parameter is only available on the exec
> resource, but you can also notify other resources such as services which
> will restart the service. There are some resources it doesn't make sense
> to notify such as files since the actual file is being validated/updated
> every puppet run regardless of what is happening with any other resource.
>
> On Nov 19, 2013, at 1:40 AM, [email protected] <javascript:> wrote:
>
> Hi!
> I need to create manifest that creates file and run some command on it's
> change. I thought that I can do it with subscribe and notify statements,
> but I can't. Can someone give me example of such manifest?
> I tried using manifest like this, and it always displays notify message,
> despite
> the fact that file has not changed
> file { '/tmp/test':
> ensure => present,
> content => "Hello",
> }
> notify {'after':
> message => "File created",
> subscribe => File['/tmp/test/'],
> }
> File['/tmp/test'] ~> Notify['after']
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-dev/a839b7ee-c1bc-40fb-a2a1-b56d47b1d415%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" 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-dev/0f41dfcf-32d9-4c51-8d52-e7f110754400%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.