Hi,
This kind of code is screaming for hiera!
But if you want to continue this way, just set another if
if $::ipaddress =~ /^172.17.3.4/ {
Data here
} elsif $::ipaddress =~ /^172.17.3./ {
Another data here
}
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/dc908091-8fbe-4e46-a5bb-4e1d1b2e503c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Facts + hiera is the short answer.
If different IP ranges means different zones or sites, just create a custom fact that returns the zone/site name. Setup the zone/site hierarchically in hiera and set the data there. Setup a higher level with the hostame in hiera and put the exceptions there.
Regards
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d79e3ecf-b10b-41e6-b1f3-71a73356f83d%40googlegroups.com.