Hi, > How to best manage location-specific configuration
I generally approach this issue with node's inheritance, managing variables at different levels, according to custom needs.. An example is better than many words: node basenode { $puppet_server = "10.42.0.10" $local_network = "10.42.0.0/24" } node devel inherits basenode { $local_network = "192.168.0.0/24" $ntp_server = "192.168.0.2" $zone = "devel" } node prod inherits basenode { $local_network = "10.0.0.0/24" $ntp_server = "10.0.0.14" $puppet_server = "10.0.0.10" $zone = "prod" } node 'delta.lab42.it' inherits devel { include general::webserver } node 'ntp.example42.com' inherits prod { $ntp_server = "192.43.244.18" include general::ntpserver } So, you can define variables (used then in templates or wherever necessary) at a top level (basenode) and redefine them at lower levels (prod, test... generally these are intended as separated networks, that may have different settings for services ar dsn, ntp and whatever). You can also redefine some variables at the node level, for managing specific cases. The definition of a $zone variable, can be useful to manage broader differencies (for example serving totally different files according to the zone, or including only specific classes class general { include sysctl include puppet include nrpe include snmpd include ntp include hosts include cron include resolver include syslog case $zone { prod: { include hardening } default: { } } } class general::webserver inherits general { $role = "webserver" include apache } Just as a side note, I define $role as the general role of a system (webserver, loadbalancer, dbserver, mailserver) and use the $role variable in classes to eventually differentiate configuration on the role od the system. So, for each node, you have 2 main characterizations: - The zone (network) where it stays - The role (functions) it has Regards Al --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---