Mercurial > repos > other > Puppet
comparison modules/firewall/manifests/linux/debian.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 |
comparison
equal
deleted
inserted
replaced
397:e22eee1d79ef | 398:66c406eec60d |
---|---|
19 # @api private | 19 # @api private |
20 # | 20 # |
21 class firewall::linux::debian ( | 21 class firewall::linux::debian ( |
22 $ensure = running, | 22 $ensure = running, |
23 $enable = true, | 23 $enable = true, |
24 $service_name = $::firewall::params::service_name, | 24 $service_name = $firewall::params::service_name, |
25 $package_name = $::firewall::params::package_name, | 25 $package_name = $firewall::params::package_name, |
26 $package_ensure = $::firewall::params::package_ensure, | 26 $package_ensure = $firewall::params::package_ensure, |
27 ) inherits ::firewall::params { | 27 ) inherits ::firewall::params { |
28 | |
29 if $package_name { | 28 if $package_name { |
30 #Fixes hang while installing iptables-persistent on debian 8 | 29 #Fixes hang while installing iptables-persistent on debian 8 |
31 exec {'iptables-persistent-debconf': | 30 exec { 'iptables-persistent-debconf': |
32 command => "/bin/echo \"${package_name} ${package_name}/autosave_v4 boolean false\" | | 31 command => "/bin/echo \"${package_name} ${package_name}/autosave_v4 boolean false\" | |
33 /usr/bin/debconf-set-selections && /bin/echo \"${package_name} ${package_name}/autosave_v6 boolean false\" | | 32 /usr/bin/debconf-set-selections && /bin/echo \"${package_name} ${package_name}/autosave_v6 boolean false\" | |
34 /usr/bin/debconf-set-selections", | 33 /usr/bin/debconf-set-selections", |
35 | 34 |
36 refreshonly => true, | 35 refreshonly => true, |
37 } | 36 } |
38 ensure_packages([$package_name],{ | 37 ensure_packages([$package_name],{ |
39 ensure => $package_ensure, | 38 ensure => $package_ensure, |
40 require => Exec['iptables-persistent-debconf'] | 39 require => Exec['iptables-persistent-debconf'] |
41 }) | 40 }) |
42 } | 41 } |
43 | 42 |
44 if($::operatingsystemrelease =~ /^6\./ and $enable == true and $::iptables_persistent_version | 43 if($::operatingsystemrelease =~ /^6\./ and $enable == true and $::iptables_persistent_version |
45 and versioncmp($::iptables_persistent_version, '0.5.0') < 0) { | 44 and versioncmp($::iptables_persistent_version, '0.5.0') < 0) { |