Dear all,
This is a continuation of another thread, but I think the question diverged
enough to create a new one.
I have a hiera hierarchy like this:
:hierarchy:
- %{fqdn}
- %{secundary_group}
- %{primary_group}
- %{productname}
- all
And I need to define the secondary/primary groups as facts, on the nodes. Gary
has suggested me to use plugins, that they will provide the facts before
puppet runs... but I was thinking: for plugins to give facts, taken directly
from within the puppet code, puppet needs to run first, doesn't it?
So, I guess I could create a module and a ruby script:
- mygroups/lib/facter/addgroup.rb
And write some code in Ruby to call Facter.add(:primary_group).
My problem is (besides the fact that I know nothing about Ruby)... how do I
insert the values for primary_group and secondary_group inside that function,
within a simple puppet run?
I guess I could use a file with the definitions, like /etc/facts.d/groups...
but that would require two puppet runs: one to create the file, and the second
that loads the facts.
I was thinking of a possible alternative... a module "mygroups" with sub-
classes, that I import from the nodes:
node 'blabla' { include mygroups::green }
And then in the module, make a mygroups/lib/facter/green.rb that does
Facter.add(:primary_group) = 'green' (or however you do it with Ruby). But how
do I make sure the module green.rb is loaded, but not the other modules that
will be there too?
Or maybe I could use parameters, that the plugin will recognize somehow?
I hope the questions are clear enough, because this is clearly not clean in my
head.
Thanks!
Pablo
--
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.