On Mar 16, 5:32 am, Maxim Ivanov <ivanov.ma...@gmail.com>
wrote:> If we have resource dependency
> A[x] -> B[y] -> C[z]
>
> how to prevent A[x] to be "executed" if error appear during
execution
> of "C[z]" ?
You appear to have the syntax backwards. A[x] -> B[y] says that A[x]
must be applied *before* B[y]. (The "->" is mnemonic for the
relative
order of resource application.) If A[x] is not applied successfully
then no attempt will be made to apply B[y] (or, therefore, C[z]). On
the other hand, by the time in error can be detected with C[z], A[x]
must have already been applied.
> I run into this problem with puppet concat:
>
> I have dependency File["/file/A] -> File["/file/B"] where
later one is
> never defined by me. It comes somewhere from Concat internals, I
> define only Concat{ "/file/B"}.
I recommend depending on internal details such as File["/file/B"] only
if they are a well documented part of the module''s external
interface. Is there some reason why you don''t want to depend on
Concat["/file/B"] instead?
> Concat itself depends on "/usr/local/bin/concatfragments.sh"
script.
> If I delete this file from server and delete all files I can see that
> "/file/A" is present while "/file/B" is absent and
there is warning
> that creation of /file/B is skipped because of dependency failure. Why
> "/file/A" is created then??
Because File["/file/A"] does not depend on File["/file/B"],
and / or
because it already existed before the Puppet run.
John
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.