Skip to content

Instantly share code, notes, and snippets.

@robinbowes
Created January 3, 2016 00:53
Show Gist options
  • Save robinbowes/ef3620a10d842819d76e to your computer and use it in GitHub Desktop.
Save robinbowes/ef3620a10d842819d76e to your computer and use it in GitHub Desktop.
# Configures a service for quagga
class millnert::quagga::service {
if $millnert::quagga::restart_on_change {
$subscription_base = [
File['daemons'],
File['debian.conf'],
File['zebra.conf']
]
if $millnert::quagga::bgpd {
$subscription_bgpd = File['bgpd.conf']
notify{'have bgpd':}
} else {
$subscription_bgpd = []
}
if $millnert::quagga::ospfd {
$subscription_ospfd = File['ospfd.conf']
notify{"have ospfd: ${subscription_ospfd}":}
} else {
$subscription_ospfd = []
}
$subscription = concat($subscription_base, $subscription_ospfd)
notify {"subscription parameter: ${subscription}":}
} else {
$subscription = []
}
service { 'quagga':
ensure => 'running',
name => 'quagga',
enable => true,
subscribe => $subscription;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment