How can I include module with parameters when inheriting node default. Is it possible?
For now, I've removed "inherits default" and changed it to node server123 { //include that //include this }
. But then whenever I make changes to default, I'll have to make the same change to node server123
.
I wonder if I should change ntp module to workaround this?
File: manifest/nodes.pp
node default {
include ssh
include ntp
ruby::install { "1.2.3-456": }
nagios { "1.2.3-456": }
}
node 'server123' inherits default {
class { 'ntp': ntpserver => 'true' } -> duplicate class defined error.
## I want to define "$ntpserver = 'true'" here, so it doesn't inherit ntp client config.
## I've tried other methods too, but none of them work.
}
File: modules/ntp/init.pp
class ntp ($ntpserver = "false") {
//erb parameters
}
if $ntpserver == 'true' {
//case $OS
//code for ntpserver template
} else {
//case $OS
//code for ntp.conf template
}