[Puppet-users] Resource Syntaxes (was Re: "Found a bug" message when purging services)

Luke Kanies luke at madstop.com
Fri Feb 2 16:02:03 CST 2007


On Jan 26, 2007, at 2:16 PM, David Schmitt wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Friday 26 January 2007 01:31, Luke Kanies wrote:
>> On Jan 25, 2007, at 5:06 PM, David Lutterkort wrote:
>>> I _really_ like that .. it seems a very natural extension of how
>>> specific resources work. The one wrinkle is that there are now at
>>> least
>>> three ways to refer to a resource:
>>>
>>>      1. service { foo: .. } when creating an element in puppet
>>>      2. Service[foo] when overriding
>>>      3. resources { service: select => ... } for otherwise  
>>> unspecified
>>>         resources
>>
>> Don't forget Service <| title == foo |>.
>
> At least 2. and 3. could be combined with the selectors from  
> collection like
> this:
>
>    Service[ selector ] { parameters }
>
> So a override would be
>
>    Service [ ntp ] { ensure => stopped }
>
> while a default would be
>
>    a) Service [ select == unmanaged ] { ensure => stopped }
>    b) Service [ * ] { ensure => stopped }
>    c) Service [ ] { ensure => stopped }
>
> That would be a natural extension of the override syntax.

This is a painful email.  I'm trying to come with a consistent model  
that maps well to Puppet's syntax, and I'm having a hard time doing  
it.  That does not speak to good language design.  This is about all  
I can come up with:

It's a good idea to at least consider trying to consolidate  
syntaxes.  The real point would be to find a consistent model of the  
world and then find one or more syntaxes that do a good job of  
reflecting that model.

Right now, we have at least five different ways of thinking about  
resources:
   1) Creation (thing { name: ... })
   2) Modification (Thing[name] { ... })
   3) Resource defaults (Thing { ... })
   4) Modifying otherwise-unmanaged resources on the system  
(resources { thing: ... })
   5) Finding resources in the database but not modifying them  
(probably) (Thing <| ... |>)

That's pretty nasty, and it looks like they could be simplified quite  
a bit.

I'm not really in a state to seriously look at this right now, but we  
should find some way to make it simpler and more consistent, and  
hopefully more powerful at the same time.

  --
  Criminal: A person with predatory instincts who has not sufficient
  capital to form a corporation.       --Howard Scott
  ---------------------------------------------------------------------
  Luke Kanies | http://reductivelabs.com | http://madstop.com




More information about the Puppet-users mailing list