Mercurial > repos > other > Puppet
comparison modules/firewall/manifests/init.pp @ 39:d6f2a0ee45c0 puppet-3.6
Add "Firewall" module
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 14 Mar 2015 20:58:03 +0000 |
parents | |
children | d9352a684e62 |
comparison
equal
deleted
inserted
replaced
38:a1960fb961c5 | 39:d6f2a0ee45c0 |
---|---|
1 # = Class: firewall | |
2 # | |
3 # Manages packages and services required by the firewall type/provider. | |
4 # | |
5 # This class includes the appropriate sub-class for your operating system, | |
6 # where supported. | |
7 # | |
8 # == Parameters: | |
9 # | |
10 # [*ensure*] | |
11 # Ensure parameter passed onto Service[] resources. | |
12 # Default: running | |
13 # | |
14 class firewall ( | |
15 $ensure = running, | |
16 $service_name = $::firewall::params::service_name, | |
17 $package_name = $::firewall::params::package_name, | |
18 ) inherits ::firewall::params { | |
19 case $ensure { | |
20 /^(running|stopped)$/: { | |
21 # Do nothing. | |
22 } | |
23 default: { | |
24 fail("${title}: Ensure value '${ensure}' is not supported") | |
25 } | |
26 } | |
27 | |
28 case $::kernel { | |
29 'Linux': { | |
30 class { "${title}::linux": | |
31 ensure => $ensure, | |
32 service_name => $service_name, | |
33 package_name => $package_name, | |
34 } | |
35 } | |
36 default: { | |
37 fail("${title}: Kernel '${::kernel}' is not currently supported") | |
38 } | |
39 } | |
40 } |