annotate modules/firewall/manifests/linux/archlinux.pp @ 398:66c406eec60d

Update and fix firewall for Ubuntu * Use later version of module (not latest because our Puppet isn't supported) * Change how we define "ensure" because Ubuntu doesn't use IPv6 methods
author IBBoard <dev@ibboard.co.uk>
date Wed, 20 Apr 2022 19:04:13 +0100
parents d9352a684e62
children adf6fe9bbc17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
1 # @summary
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
2 # Manages `iptables` and `ip6tables` services, and creates files used for persistence, on Arch Linux systems.
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 #
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
4 # @param ensure
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
5 # Ensure parameter passed onto Service[] resources. Valid options: 'running' or 'stopped'. Defaults to 'running'.
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 #
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
7 # @param enable
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
8 # Enable parameter passed onto Service[] resources. Defaults to 'true'.
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 #
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
10 # @param service_name
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
11 # Specify the name of the IPv4 iptables service. Defaults defined in firewall::params.
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 #
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
13 # @param package_name
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
14 # Specify the platform-specific package(s) to install. Defaults defined in firewall::params.
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
15 #
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
16 # @param package_ensure
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
17 # Controls the state of the iptables package on your system. Valid options: 'present' or 'latest'. Defaults to 'latest'.
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
18 #
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
19 # @api private
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 #
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 class firewall::linux::archlinux (
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
22 $ensure = 'running',
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
23 $enable = true,
398
66c406eec60d Update and fix firewall for Ubuntu
IBBoard <dev@ibboard.co.uk>
parents: 275
diff changeset
24 $service_name = $firewall::params::service_name,
66c406eec60d Update and fix firewall for Ubuntu
IBBoard <dev@ibboard.co.uk>
parents: 275
diff changeset
25 $package_name = $firewall::params::package_name,
66c406eec60d Update and fix firewall for Ubuntu
IBBoard <dev@ibboard.co.uk>
parents: 275
diff changeset
26 $package_ensure = $firewall::params::package_ensure,
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 ) inherits ::firewall::params {
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 if $package_name {
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 package { $package_name:
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
30 ensure => $package_ensure,
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 }
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 }
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 service { $service_name:
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 ensure => $ensure,
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 enable => $enable,
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 hasstatus => true,
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 }
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40 file { '/etc/iptables/iptables.rules':
398
66c406eec60d Update and fix firewall for Ubuntu
IBBoard <dev@ibboard.co.uk>
parents: 275
diff changeset
41 ensure => file,
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 before => Service[$service_name],
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43 }
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 file { '/etc/iptables/ip6tables.rules':
398
66c406eec60d Update and fix firewall for Ubuntu
IBBoard <dev@ibboard.co.uk>
parents: 275
diff changeset
46 ensure => file,
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47 before => Service[$service_name],
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 }
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 }