Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
## set up /etc/motd class motd { common::concat_file{"/etc/motd": owner => root, group => root, mode => 644, } Common::Concat_snippet{ owner => root, group => root, directory => "/etc/motd.d", } common::concat_snippet{"motd_header": order => 00, directory => "/etc/motd.d", source => ["puppet://puppet/modules/motd/motd.$fqdn", "puppet://puppet/modules/motd/motd.$domain", "puppet://puppet/modules/motd/motd.$environment"] } common::concat_snippet{"motd_modules_header": order => 01, content => "\tPuppet Modules:\n", } common::concat_snippet{"motd_modules_footer": order => 99, content => " \n\n", } } ## ability to register into /etc/motd define motd::register($content = "", $order = 10) { case $content { "": { $msg = $name } default: { $msg = $content } } common::concat_snippet{"motd_${name}": owner => root, group => root, directory => "/etc/motd.d", content => "\t\t- ${msg}\n", order => $order, } } ## some module adding itself to /etc/motd class stomphost { motd::register{"stomp host": } } ## sample output Welcome to xxxxx hosted at Hetzner, Germany Puppet Modules: - apache - iptables - stomp host - xen dom0 skeleton
This paste will be private.
From the Design Piracy series on my blog: