On Thu, May 17, 2012 at 11:30 AM, Rufus McDufus <r...@bamalam.com> wrote:
> I had a bit of a play with this today and couldn't get anything working...

Hrm, I'm sure we'll be able to sort it out.

> Are you actually trying to overload the real motd module?

No, the module named site and the module named motd can exist in the
same directory along the modulepath.

I also notice you have "inherits" in there, which isn't necessary and
can complicate things.  This pattern is really just providing a string
to the motd class in the motd module.  That's really it.  If the
string isn't provided (It's unset), then the motd module itself will
use it's own string from it's own template.

So for example your manifests might be laid out like this:

/etc/puppet/modules/site/manifests/init.pp # <= class site { ... }
/etc/puppet/modules/motd/manifests/init.pp # <= class
motd($motd_content) { ... }
/etc/puppet/modules/motd/manifests/motd.pp # <= class site::motd { ... }

In that third manifest for class site::motd you could do this:

class site::motd {
  # Declare the motd class from the motd module, but tell it to use
  # a template from the site module, not it's own template.
  class { motd: motd_content => template("site/motd.erb") }
}

You could just as easily pass a string directly rather than use the
template function:

class site::motd {
  class { motd: motd_content => "Hello World!\n" }
}

Hope this helps.

I think avoiding "inherits" will help clear up the issue you're facing.

-Jeff

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