In regard to: Re: [Puppet Users] hiera questions, llow...@oreillyauto.com...:
On Thursday, June 28, 2012 2:04:09 PM UTC-5, R.I. Pienaar wrote:
----- Original Message -----
I would make facts on the nodes for these. Let say $role and $subrole
and then just use those in your hierarchy with %{role} and %{subrole}
thus allowing you to set variable for all those machines there.
That's simple enough, and the docs [1] for creating a custom fact are
mostly straightforward.
I would echo what others have said. Create some custom facts for
personalities or roles (and subroles, etc., if necessary) for your
systems, and have your hierarchy set to search based on those. We use:
:hierarchy: - secure/fqdn/%{clientcert}
- fqdn/%{clientcert}
- secure/location/%{location}
- location/%{location}
- secure/common
- common
Note that "location" is a custom fact for us, based on datacenter. You
could do something similar, just don't go crazy with the hierarchy levels.
The one thing I am unclear on, in the "plugins in modules" [2] document, it
says that if you are going to put your custom stuff in a module (such as in
their example, named 'custom') it says to follow the standard layout, and
that you have to have a manifests/init.pp.
If all that is actually in the thing is lib/facter/myfact.rb, what do I put
in the manifests/init.pp ? Is it enough for it to exist but be empty?
Yes it is.
You probably have some kind of "base" or "our_site" module already that
just does things like
include ntp
include admin_packages
include ssh
include syslog
etc. You could associate your custom fact(s) with that module by putting
them in the lib/facter directory for that module.
Tim
--
Tim Mooney tim.moo...@ndsu.edu
Enterprise Computing & Infrastructure 701-231-1076 (Voice)
Room 242-J6, IACC Building 701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
--
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.