Thanks for the detailed reply!
On Thu, Sep 22, 2011 at 07:18:13AM -0700, jcbollinger wrote:
>
> It sounds like your problem is that you don't in fact want to
> collect *resources* at all -- rather, you want to collect *data*.
> That is not what exported resources are for.
That's entirely correct. I knew I was hacking around a "not really
designed to do this", I just thought it might be possible anyway.
> Exported resources are resources intended to be managed on nodes
> other than (or in addition to) the one declaring them. There is
> necessarily an aspect of data sharing to that, but they should not
> be viewed as a vehicle for data sharing.
OK.
> > It sounds from what people are saying like there really isn't a
> > reasonable way to do this yet?
>
> Again, it depends on what "this" is, but I think you are
> approaching the problem backwards. If you need centralized data
> then you should create a data source and use it to drive your
> resource declarations wherever appropriate. Details depend a lot
> on your general approach and the complexity of the data, but if
> you want to access your shared data store from within Puppet
> itself then I'd recommend looking into hiera.
The data right now is *incredibly* simple; just a list of email
addresses (one for each user defined on each host everywhere).
Adding a whole data source system just for that seems like
significant overkill.
Using the @@file trick, while cheating as you say, seems a lot less
effort until/unless Puppet integrates some method of data sharing.
Note that by "integrates" there I don't mean "comes with" or
anything, more like "I can run a couple of yum installs and tweak a
couple of config variables and it works", which I'm pretty sure
isn't the case now for any such shared data stores.
To be more specific, I have user definitions in my site.pp for
various users that have accounts on various hosts. The user defines
currently look like this:
users::normal { bob: id => 111, email => '[email protected]' }
and that is used to set up various things about that user on the
host that it's defined on (i.e. the actual account). I would, in
addition, like to collect all the email addresses in one place on a
particular host.
I'm actually not sure that Hiera would solve the problem anyway; if
I have a list of user information stored in a Hiera .yaml file, it's
not at all obvious to me how to access the email addresses in such
away as to make them available all at once in a template somewhere.
I suppose if I could walk the Hiera tree in a template that would
work; is that possible?
-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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.