On Thu, Sep 22, 2011 at 02:24:45PM -0700, jcbollinger wrote:
> 
> You are missing the obvious: 

I had a feeling I might be.

> anything in your manifests themselves is at least potentially
> available to all nodes.  Taking your e-mail address example, you
> can do this:
> 
> class email {
>   $addresses = {
>     'alice' => '...@alice.com',
>     'bob'   => '...@bob.com',
>     ...
>     'zoe'   => '...@foo.net'
>   }
> }
> 
> There's your data store.  You can then remove the 'email'
> parameter from users::normal, and instead have it look up the
> e-mail address:
> 
> define users::normal ($id) {
>   $email = $email::addresses[$name]
>   ...
> }
> 
> And the whole of $email::addresses is sitting there for any node
> that wants it.

That's pretty excellent.  Thank you.

> Why then, you may ask, are exported resources useful?  Why not
> take a fully data-driven approach along the lines above?  I'm glad
> you asked.  Exported resources can do something that the above
> approach cannot: their properties and even their very existence
> can depend on the facts pertinent to the nodes exporting them.  If
> you are considering a use of exported resources that doesn't
> somehow leverage that characteristic, then you are looking at the
> wrong tool.

Where I've found them useful, fwiw, is for /etc/hosts and
ssh_known_hosts.

Although even that could probably be put into a data-driven external
something or other.

-Robin

-- 
http://singinst.org/ :  Our last, best hope for a fantastic future.
Lojban (http://www.lojban.org/): The language in which "this parrot
is dead" is "ti poi spitaki cu morsi", but "this sentence is false"
is "na nei".   My personal page: http://www.digitalkingdom.org/rlp/

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to