In regard to: [Puppet Users] Optional values from Hiera (no default value),...:

Hello Puppet List,

I'm writing a module that should take an optional value and I want to
get it (amongst other places) from Hiera.

$repository = $::java_repository ? {
 undef   => hiera('java_repository')
 default => $::java_repository,
}

hiera() can take a second argument which is the default you want to
supply if no data store provides a value.  Before you ask, no, I don't
know where that's documented, but we've been using it for a while in
our puppet manifests and it has been mentioned on the list even today.

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.

Reply via email to