aboutsummaryrefslogtreecommitdiff
path: root/manifests/config.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/config.pp')
-rw-r--r--manifests/config.pp46
1 files changed, 46 insertions, 0 deletions
diff --git a/manifests/config.pp b/manifests/config.pp
new file mode 100644
index 0000000..43c68ee
--- /dev/null
+++ b/manifests/config.pp
@@ -0,0 +1,46 @@
+# @api private
+# This class handles the configuration file. Avoid modifying private classes.
+class ferm::config {
+
+ # this is a private class
+ assert_private("You're not supposed to do that!")
+
+ # copy static files to ferm
+ # on a long term point of view, we want to package this
+ file{'/etc/ferm.d':
+ ensure => 'directory',
+ }
+ -> file{'/etc/ferm.d/definitions':
+ ensure => 'directory',
+ }
+ -> file{'/etc/ferm.d/chains':
+ ensure => 'directory',
+ }
+
+ if $ferm::manage_configfile {
+ concat{$ferm::configfile:
+ ensure => 'present',
+ }
+ concat::fragment{'ferm_header.conf':
+ target => $ferm::configfile,
+ content => epp("${module_name}/ferm_header.conf.epp"),
+ order => '01',
+ }
+
+ concat::fragment{'ferm.conf':
+ target => $ferm::configfile,
+ content => epp("${module_name}/ferm.conf.epp"),
+ order => '50',
+ }
+ }
+
+ ferm::chain{'INPUT':
+ policy => $ferm::input_policy,
+ }
+ ferm::chain{'FORWARD':
+ policy => $ferm::forward_policy,
+ }
+ ferm::chain{'OUTPUT':
+ policy => $ferm::output_policy,
+ }
+}