Hi,
Was trying today to set up the following (not at work, so don''t have
exact code, can provide that tomorrow if needed):
softlink A points to file B
Developer does a build, repoints soft link A to file C
This triggers an exec action to clean up old build directories
I set up something like this
class apps_files {
file {
''/path/to/link'':
checksum => md5,
}
exec {
''code to execute on change'':,
path => ''/usr/local/bin:/usr/bin:/bin'',
subscribe => file[''/path/to/link''],
refreshonly => true
}
}
I changed the soft link on one of the clients this affects, nothing
happened. Looked in the /var/puppet/state/state.yaml file and saw
something like this
[File /path/to/link]:
checksum: {}
synced: Date....
No checksum on the link, no ''last checked'' time either. I
then tried adding in
ensure => present
But that had the same behavior .. tried changing md5 to timestamp, same issue.
Anyone know how to configure puppet so that it just watches the target
of a soft link without caring about what it points to so that
''subscribe'' works properly for triggering an exec?
Verified the client had the configuration in
/etc/puppet/localconfig.yaml and was getting the changes as I changed
the server-side configs throughout the process.
Fell back to setting this all up as a daily task using
''schedule,''
would definitely rather have it done just when the link changes :).
Thanks!
- Max
Luke Kanies
2007-Mar-09 16:29 UTC
Re: Using changes in a symlink target as a trigger for an ''exec''
On Mar 8, 2007, at 9:04 PM, Max wrote:> > file { > ''/path/to/link'': > checksum => md5, > }Try ''links => follow''. -- When one admits that nothing is certain one must, I think, also admit that some things are much more nearly certain than others. -- Bertrand Russell --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Max
2007-Mar-09 16:54 UTC
Re: Using changes in a symlink target as a trigger for an ''exec''
Luke,
My apologies, I did not read the type documentation for File clearly enough.
Works like a charm :), I see that uses a time ''checksum'' so
all that
is needed now is
file {
''/path/to/link'':
links => follow
}
Just posting that in case someone else fails to see the
''links''
parameter documentation (as I did by not reading it carefully enough).
Appreciate the help and my apologies for not RTFM''ing carefully enough.
- Max
On 3/9/07, Luke Kanies <luke@madstop.com> wrote:> On Mar 8, 2007, at 9:04 PM, Max wrote:
> >
> > file {
> > ''/path/to/link'':
> > checksum => md5,
> > }
>
> Try ''links => follow''.
>
> --
> When one admits that nothing is certain one must, I think, also admit
> that some things are much more nearly certain than others.
> -- Bertrand Russell
> ---------------------------------------------------------------------
> Luke Kanies | http://reductivelabs.com | http://madstop.com
>
>
> _______________________________________________
> Puppet-users mailing list
> Puppet-users@madstop.com
> https://mail.madstop.com/mailman/listinfo/puppet-users
>
Luke Kanies
2007-Mar-09 17:05 UTC
Re: Using changes in a symlink target as a trigger for an ''exec''
On Mar 9, 2007, at 10:54 AM, Max wrote:> Luke, > > My apologies, I did not read the type documentation for File > clearly enough. > > Works like a charm :), I see that uses a time ''checksum'' so all that > is needed now isGlad to hear it.> Appreciate the help and my apologies for not RTFM''ing carefully > enough.I don''t think it''s a very commonly used feature, so it''s not surprising you hadn''t come across it. Any recommendations on how to make things like this more prominent would be useful. -- Morgan''s Second Law: To a first approximation all appointments are canceled. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Maybe Matching Threads
- Add the ability to ''eval'' ruby code in exec type?
- Watch a file during the day and just report changes, replace on a scheduleat night if chnged during the day: needs to be a type?
- Unless in exec doesn''t seem to be honored on notify.
- logoutput attribute on exec type
- Build a cmdline for exec from optional parameters