I still can't come up with a scenario where this would ever be an issue.
Auto-creating a resource (especially a directory) is a greater level of
spooky action at a distance since it's actually *doing* something to your
system and I'm very against that when possible. (It also bloats your
catalog, but that's not as much of an issue).
Cases:
1Q) file { '/home': ensure => link, target => '/srv/home' }
1A) Broken symlink may be created, who cares
2Q)
file { '/home': ensure => link, target => '/srv/home' }
file { '/srv/home': ensure => directory }
2A) /srv/home gets created before /home, good stuff
3Q)
file { '/home': ensure => link, target => '/srv/home' }
file { '/srv/home': ensure => link, target => '/opt/home' }
3A) /home -> /srv/home -> <broken>. This is accurate
What other scenarios are there that I'm missing?
Trevor
On Fri, Feb 27, 2015 at 11:59 AM, Felix Frank <
[email protected]> wrote:
> Hi,
>
> thanks for building this.
>
> I must admit, I find the prospect a little frightening. The logic that
> picks the autorequire target makes sense, but I see quite some potential
> for surprising the user with weird dependency cycles.
>
> What I'd like to see instead would be for the user type to actually
> spawn a file resource that manages the home directory when managehome =>
> true is in use.
>
> There would be some perks to such an approach:
> 1. This would be backwards compatible (manifests that contain the home
> directory will keep the resource from being generated again)
> 2. You get the autorequire for free (from the very file resource)
> 3. If issues arise, the user is presented with a very clear message
> about just what resource just blew up in their face.
>
> The key would be the additional resources generator. I did something
> similar to the naginator types a while ago.
>
> Cheers,
> Felix
>
> On 02/26/2015 12:41 AM, Raphaël Pinson wrote:
> > Hello,
> >
> >
> > As per Kylo's comment in PR for PUP-4036
> > <https://github.com/puppetlabs/puppet/pull/3645#issuecomment-76032829>,
> > I'd like to discuss the possibility and implications of autorequiring
> > parent directories of the home directory for user resources.
> >
> > As stated in the PR, the idea came from stumbling upon a code like this
> one:
> >
> > file { '/srv/home': ensure => directory }
> > file { '/home': ensure => link, target => '/srv/home' } -> User <| |>
> >
> >
> > where it made a lot of sense that all users should just autorequire the
> > nearest parent directory to their home directory.
> >
> > What are your thoughts on this feature?
> >
> >
> > Cheers,
> >
> > Raphaël
>
> --
> 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/54F0A279.20006%40alumni.tu-berlin.de
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
[email protected]
-- This account not approved for unencrypted proprietary information --
--
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/CANs%2BFoV%3DRqYt5_0EMiH%2BtVzq2545%2BzsXf-FSbs4uM2zeBn3ASg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.