Mercurial > repos > other > Puppet
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 |
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 | 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 | 5 setcode do |
6 # Throw away STDERR because dpkg >= 1.16.7 will make some noise if the | |
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 | 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 | 12 nil |
13 else | |
14 version | |
15 end | |
16 end | |
17 end |