2012-09-18 02:06:48 +02:00
|
|
|
class puppetdb::server::firewall(
|
|
|
|
$port = $puppetdb::params::ssl_listen_port,
|
|
|
|
$manage_redhat_firewall = $puppetdb::params::manage_redhat_firewall,
|
|
|
|
) inherits puppetdb::params {
|
|
|
|
# TODO: figure out a way to make this not platform-specific; debian and ubuntu
|
|
|
|
# have an out-of-the-box firewall configuration that seems trickier to manage.
|
|
|
|
# TODO: the firewall module should be able to handle this itself
|
2012-09-20 23:46:26 +02:00
|
|
|
if ($manage_redhat_firewall and $puppetdb::params::firewall_supported) {
|
2012-09-18 02:06:48 +02:00
|
|
|
|
2012-09-21 19:17:42 +02:00
|
|
|
exec { 'puppetdb-persist-firewall':
|
2012-09-20 23:46:26 +02:00
|
|
|
command => $puppetdb::params::persist_firewall_command,
|
|
|
|
refreshonly => true,
|
|
|
|
}
|
2012-09-18 02:06:48 +02:00
|
|
|
|
2012-09-20 23:46:26 +02:00
|
|
|
Firewall {
|
2012-09-21 19:17:42 +02:00
|
|
|
notify => Exec['puppetdb-persist-firewall']
|
2012-09-20 23:46:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
firewall { "${port} accept - puppetdb":
|
|
|
|
port => $port,
|
|
|
|
proto => 'tcp',
|
|
|
|
action => 'accept',
|
|
|
|
}
|
2012-09-18 02:06:48 +02:00
|
|
|
}
|
|
|
|
}
|