Monachus
By: a guest | Feb 18th, 2010 | Syntax:
None | Size: 0.72 KB | Hits: 37 | Expires: Never
class global::network {
# the variables $ip and $netmask would be used by the template (change as needed)
define network_handler( $ip, $netmask ) {
file { "ifcfg-${name}":
path => "/etc/sysconfig/network-scripts/ifcfg-${name}",
content => template("/your/template"),
}
exec { "reload_${name}":
command => "/bin/logger 'puppet-${name}',
refreshonly => true,
subscribe => File["ifcfg-${name}"],
}
}
}
class network {
include global::network
# set up bond0.3
network_handler { "bond0.3":
ip => "192.168.0.10",
netmask => "255.255.255.0",
}
# set up bond0.4
network_handler { "bond0.4":
ip => "192.168.0.20",
netmask => "255.255.255.0",
}
}