Skip to content

Instantly share code, notes, and snippets.

@jtopper
Created May 16, 2012 16:06
Show Gist options
  • Save jtopper/2711679 to your computer and use it in GitHub Desktop.
Save jtopper/2711679 to your computer and use it in GitHub Desktop.
lolcurrying
class sf_apache::params {
$fw_name_service = '0080 apache service'
}
class sf_apache::config ( $httpd_config ) {
include sf_apache::params
@firewall { $sf_apache::params::fw_name_service:
proto => "tcp",
dport => $httpd_config['Port']
}
# ...
}
class sf_apache::firewall_allow::service ( $sources ) {
include sf_apache::params
Firewall<| title == $sf_apache::params::fw_name_service |> {
source => $sources
}
}
# Permits usage like:
class { sf_apache:
httpd_config => {
'MPM' => 'prefork',
'StartServers' => '10',
'MinSpareServers' => '10',
'MaxSpareServers' => '10',
'ServerLimit' => '256',
'MaxClients' => '256',
'MaxRequestsPerChild' => '4000',
'Port' => '80'
}
}
class { "sf_apache::firewall_allow::service":
sources => '127.0.0.1/32'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment