Collectors, resource defaults and the realisation side-effect

32 views
Skip to first unread message

Daniele Sluijters

unread,
Jul 19, 2014, 2:24:36 PM7/19/14
to puppe...@googlegroups.com
Hi all,

I kinda got lost in Henrik's RFC wrt Puppet resource defaults. Perhaps this was already discussed there but I couldn't find it quickly.

What I would like to propose is that the realisation side-effect of collectors be removed and instead have an explicit way to realise resources.

The problem is most obvious when you look at configuring a package manager and making sure that it is _before_ Package resources can be processed.

The canonical way of doing this, and the way we recommend for users of puppetlabs-apt, is this little snippet:
Class['apt::update'] -> Package <||>

Every apt::source notifies a refresh_only exec inside the apt::update class so this finalises the circle.

The reason the module doesn't do this by default is because of the side effect on <||>. If people were using virtual package resources, for whatever reason, our module would now realise them for them and they lose the little bit of control they had over that part.

The other way to solve this that I'm aware of would be stages, but you know, stages.

Essentially what I want to be able to do is declare the intent of a relation between any two resources or 'bags' of resource types in the catalog and have that relation taken into account when the resource is realised, without causing realisation at that point.

-- 
Daniele Sluijters


Henrik Lindberg

unread,
Jul 20, 2014, 5:33:22 PM7/20/14
to puppe...@googlegroups.com
Completely agree - the language needs a way to query that is separate
from realizing and overriding at the same time.

We should get to that after 4.0.

- henrik

> --
> Daniele Sluijters
>
>
> --
> 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
> <mailto:puppet-dev+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-dev/cd0817d9-1958-4453-a08a-a2de9ace6f97%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-dev/cd0817d9-1958-4453-a08a-a2de9ace6f97%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Ken Barber

unread,
Jul 20, 2014, 6:02:59 PM7/20/14
to puppe...@googlegroups.com
>> Essentially what I want to be able to do is declare the intent of a
>> relation between any two resources or 'bags' of resource types in the
>> catalog and have that relation taken into account when the resource is
>> realised, without causing realisation at that point.
>>
>
> Completely agree - the language needs a way to query that is separate from
> realizing and overriding at the same time.
>
> We should get to that after 4.0.

+1. You can always make compound tools/functions/syntactic sugar to
hide the details from those that don't care to sufficiently provide
both the simple and hard solution as appropriate.

ken.
Reply all
Reply to author
Forward
0 new messages