Skip to content

Instantly share code, notes, and snippets.

@b4ldr
Created February 19, 2020 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b4ldr/4a9a932da56a9e6ca785cbcba1ccf138 to your computer and use it in GitHub Desktop.
Save b4ldr/4a9a932da56a9e6ca785cbcba1ccf138 to your computer and use it in GitHub Desktop.
class gobgp (
String $config_content,
stdlib::Unixpath $config_file = '/etc/gobgp.conf'
) {
ensure_packages(['gobgp'])
file{$config_file,
ensure => file,
content => $config_content,
notify => Service['gobgp']
require => Package['gobgp']
}
service {'gobgp':
ensure => running,
enabled => true,
}
}
class profile::flowspec {
# for an untemplated file located in modules/profile/files/flowspec
class{'gobdp':
config_content => file('profile/flowspec/bgpd.conf')
}
# for an templated file located in modules/profile/templates/flowspec
# class{'gobdp':
# config_content => template('profile/flowspec/bgpd.conf')
#}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment