I'd like to set default values for parameters that will be passed to epp 
templates.  However, the default value is based on another parameter.  I 
understand that variables are immutable but this is a parameter that 
shouldn't be touched unless it wasn't set.

Here is an example construct with a few of my syntax attempts.

class myClass (
String $base_dir,
Optional[String] $conf_dir,
) {
#Attempt 1: Failed
if $myClass::conf_dir == undef { $myClass::conf_dir = "$myClass::base_dir
/conf" }

#Attempt 2: Failed
if !$myClass::conf_dir { $myClass::conf_dir = "$myClass::base_dir/conf" }

#Attempt 3: Failed
unless $myClass::conf_dir { $myClass::conf_dir = "$myClass::base_dir/conf" }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8e2db8c1-7353-4360-adc5-00713e1c0214%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to