annotate modules/firewall/lib/facter/iptables_persistent_version.rb @ 482:d83de9b3a62b default tip

Update hiera.yaml within Puppet config Forgot that we manage it from here. Now has content to match new packages
author IBBoard <dev@ibboard.co.uk>
date Fri, 30 Aug 2024 16:10:36 +0100
parents adf6fe9bbc17
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
398
66c406eec60d Update and fix firewall for Ubuntu
IBBoard <dev@ibboard.co.uk>
parents: 275
diff changeset
1 # frozen_string_literal: true
66c406eec60d Update and fix firewall for Ubuntu
IBBoard <dev@ibboard.co.uk>
parents: 275
diff changeset
2
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 Facter.add(:iptables_persistent_version) do
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
4 confine operatingsystem: ['Debian', 'Ubuntu']
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 setcode do
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 # Throw away STDERR because dpkg >= 1.16.7 will make some noise if the
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 # package isn't currently installed.
478
adf6fe9bbc17 Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents: 398
diff changeset
8 cmd = "dpkg-query -Wf '${Version}' netfilter-persistent 2>/dev/null"
adf6fe9bbc17 Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents: 398
diff changeset
9 version = Facter::Core::Execution.execute(cmd, { on_fail: nil })
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
11 if version.nil? || !version.match(%r{\d+\.\d+})
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 nil
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 else
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 version
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 end
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 end
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 end