Hi, While setting up persistant load balancer configuration in linux virtul server, I ended up with following two templates.
On the load balancer: In lvs/manifests/ifcfg-lo_lb.erb
DEVICE=eth1:lb
IPADDR=<IP_ADDRESS>
NETMASK=255.255.255.0
NM_CONTROLLED=no
On the app servers: In lvs/manifests/ifcfg-eth1_lb.erb
DEVICE=lo:lb
IPADDR=<IP_ADDRESS>
NETMASK=255.255.255.255
ONBOOT=yes
[these params is to be put in hiera]
Templates are instantiated in the following puppet classes
1) lvs/manifests/appserver.pp
class lvs::appserver ...{
file { '/etc/sysconfig/network-scripts/ifcfg-lo:lb':
ensure => present,
content => template("${module_name}/ifcfg-lo_lb.erb"),
owner => root,
}
}
2) lvs/manifests/lb.pp
class lvs::lb ... {
file { '/etc/sysconfig/network-scripts/ifcfg-eth1:lb':
ensure => present,
content => template("${module_name}/ifcfg-eth1_lb.erb"),
owner => root,
}
}
Is it possible to use one common template instead of two with some conditional statements differentiating load balancer and app server?
Regards,
Pearl