On Tue, Oct 18, 2011 at 12:11 PM, Steve Snodgrass <phe...@gmail.com> wrote:
> To be a little more explicit about what Nan said, if you use a
> parameterized class, any parameters you passed into the class will
> also be available in the template.  The same things goes for a define.

I've got a class:

class libapache2_mod_shib2::config($environment = "production") {
  if ($environment == "production") {
    $idp_server        = "idp2.shib.umn.edu"
    $metadata_provider = "UofM-IDP-metadata.xml"
  } elsif ($environment == "testing") {
    $idp_server        = "idp-test.shib.umn.edu"
    $metadata_provider = "UofM-IDP-test-metadata.xml"
  } else {
    fail("ensure parameter must be production or testing")
  }

  file { "/etc/shibboleth/shibboleth2.xml":
    owner   => "root",
    group   => "root",
    mode    => 0644,
    content => 
template("libapache2_mod_shib2/etc/shibboleth/shibboleth2.xml.erb"),
    require => Class["libapache2_mod_shib2::install"],
    notify  => Service["shibd"],
  }
}

In the template it seems that:

$libapache2_mod_shib2::config::environment

didn't work. However,

scope.lookupvar('libapache2_mod_shib2::config::envirnoment')

did.

Should the former mechanism work?

Thanks,

-mz

-- 
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