file { '/srv/home': ensure => directory } file { '/home': ensure => link, target => '/srv/home' } -> User <| |>
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/9c55b0bf-eae3-41f9-8103-e69870f1297d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I think I filed a bug about this a while back.+1 for autorequiring targets
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/54F0A279.20006%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.
On 2015-02-26 20:31, John Bollinger wrote:
> Symbolic links do _not_ have the same kind of relationship with their
> targets. A link can be managed entirely independently of its target,
> therefore Puppet should not automatically demand a particular order.
> As a general rule, it is important for resource types to model their
> corresponding physical resources as cleanly as possible, lest
> unintended consequences arise. In this particular case, autorequiring
> link targets can create dependency cycles in cases that would
> otherwise be perfectly good.
Examples please? Everything I can currently think of right now (and
it's night time here, so please be gentle) would create invalid
filesystem layouts if the symlink points to one of it's own
subdirectories.
file { '/path/link':
ensure => 'link,
target => '/other/path'
before => Exec['create-target-as-fifo']
}
exec { 'create-target-as-fifo':
before => File['/other/path']
}
file { '/other/path':
owner => 'fifo_own',
mode => '0600'
}
> I observe, too, that in the example presented, the convenience
> afforded by the proposed autorequirement is a function of the *use*
> of
> the resource, not inherent in the resource itself. Puppet cannot know
> that, or be expected to account for it. It is the manifest author who
> should be expected to take responsibility for modeling such
> site-specific requirements.
I would argue, that the primary *use* of a symlink is to point to
something. Even in the obscure case of pointing to something that is
managed as ensure=>absent, I would posit that the intended state of the
symlink is only reached after its target's managed state is reached too.
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/6b2d70cc-0293-4d66-8b32-08cd56ba130f%40googlegroups.com.
Ok, you certainly have a working counter example, but I feel that it *should* actually fail and that this is a bug.
I would like to propose that symlinks should naturally (i.e. autorequire*) come *after* all components of relevant file resources because otherwise they are systemically invalid.
Thinking about this further, should Puppet even be able to create invalid symlinks?
I don't feel like it should as they can cause all sorts of havoc on a system with a code (expectation)-based infrastructure. Additionally, having Puppet complain on making a link to something that hasn't yet been mounted could be a very good thing since you would be aware that your underlying external system requirements have not been correctly met.It *should* leave invalid symlinks alone unless told to remove them, of course.
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/5e3447ea-8ebe-4cfa-85df-56decb5506d4%40googlegroups.com.
3) Setting :force => true, disables the warning message (in theory, you would only do this after seeing the message)2) Warnings on dangling symlinks are the default (because you *probably* don't want them)Hmm....Ok, how about this:1) Dangling symlinks are allowed
Would that work?3a) For a less destructive method, something like 'dangle => true' could be allowed I suppose4) Autorequires happen so that you don't get spurious warning messages
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/1f9719c7-3729-4311-b93f-c386408f1e6d%40googlegroups.com.
Well, there's my concrete example of where dangling symlinks are used in the wild....Ok, back to autorequires. I'm still not convinced that it's beneficial to not have it in place.
I suppose that I could do some hack-fu like I did with 'group' so that people that want it could patch it into place but that seems a bit unfortunate.
Are auto* items things that should be allowed to be disabled on a resource-by-resource basis using a Metaparameter? That way you can do the 'usual' thing but, should it cause an issue, just turn it off for that resource and declare things explicitly.
I'd much rather be able to shim in my own auto* items from the DSL (I mean, it's an Array),
if the catalog does fail on account of the link's target not being managed soon enough, then it will be applied successfully the next time (barring other errors); and
What's so bad about manually declaring a link to depend on its target when that's actually needed? If the situation in PUP-4036 is representative of such situations, then I don't see why a manifest author should even be taken by surprise by such a need.
I don't see why it should be inappropriate for a parameter to modulate which autorequirements are in effect. Alternatively, if you want to cast link validity as an aspect of the File resource state then a new 'ensure' value could be created to model that. Perhaps something like "link-valid". When that 'should' value was in effect, the resource could reasonably autorequire its target, and would be expected to fail if the target did not exist when the link was being applied.
I'd much rather be able to shim in my own auto* items from the DSL (I mean, it's an Array),
I don't follow you there. Do you mean you want some kind of global flag to enable the proposed autorequirements being generated? I don't see how that fits directly into the DSL, but you could address it within your own code by using a wrapper definition around the File type. Or if you mean on a case-by-case basis then what does "auto" have to do with it? Just declare the relationship you want.
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/b26f9b97-c98d-4ed5-b0c7-a09b9e8079fa%40googlegroups.com.
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/54F5851B.10804%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.
Disadvantages to symlinks autorequiring their targets:
- Many unneeded resource relationships are generated.
- Under some circumstances, Puppet will needlessly create relationship cycles.
- Although the autorequirement could be overridden, it would be impossible to model the usual true state of affairs, that the relative order of applying link and target does not matter.
Hello
On 02.03.2015 22:21, John Bollinger wrote:
Disadvantages to symlinks autorequiring their targets:
- Many unneeded resource relationships are generated.
- Under some circumstances, Puppet will needlessly create relationship cycles.
- Although the autorequirement could be overridden, it would be impossible to model the usual true state of affairs, that the relative order of applying link and target does not matter.
maybe I am missing something here but
a) a resource relationship that is autorequired can be overwritten with explicit requires (at least last time I checked). So while dependency cycles can occur, you are likely to resolve them with some explicit requires)
b) a file resource (symlink) already autorequires its target since puppet 2.7.10 (https://projects.puppetlabs.com/issues/5421)
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/b8d5e560-9357-4d8f-8234-3b593d9be246%40googlegroups.com.
On Tuesday, March 3, 2015 at 1:35:28 PM UTC-6, Stefan Schulte wrote:
[..]
maybe I am missing something here but
a) a resource relationship that is autorequired can be overwritten with explicit requires (at least last time I checked). So while dependency cycles can occur, you are likely to resolve them with some explicit requires)
Known, acknowledged, and covered in the discussion (even in the quoted text).
Yes you can override an autorequirement, but if you ever should need to do so -- indeed, if it is ever valid to do so -- then the autorequirement is in error. It shouldn't be automatic if there's any reasonable chance that it's wrong or even just unneeded.
b) a file resource (symlink) already autorequires its target since puppet 2.7.10 (https://projects.puppetlabs.com/issues/5421)
What a shame.
I am not saying that the current behaviour is correct/better or that your argument is invalid (you have a good point IMHO). I just wanted to point out that it is implemented for quite a while now and personally I am not aware that this caused any problems.
If it were of surpassing importance to me that all my tools were designed and behaved exactly exactly as I liked, then I would have no choice but to write them myself. Although I can be impassioned, in the end, I'm a lot more pragmatic than that.
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/83c8406c-fd1c-40bc-abb5-2ed0831dc038%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Mar 4, 2015, at 1:25 PM, Trevor Vaughan <tvau...@onyxpoint.com> wrote:If it were of surpassing importance to me that all my tools were designed and behaved exactly exactly as I liked, then I would have no choice but to write them myself. Although I can be impassioned, in the end, I'm a lot more pragmatic than that.This should be engraved in stone somewhere.....
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/54F98667.5040505%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/54F9A1D6.8060107%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.
Felix
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/54F9B3CA.7030700%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.
--
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 puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CAAAzDLfcUqwhAAg-k_KF%2BGU%2B1txbSfg6%2Bbgh6Y1OXjojfK5e5w%40mail.gmail.com.