annotate modules/firewall/lib/facter/iptables_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_version) do
275
d9352a684e62 Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents: 39
diff changeset
4 confine kernel: :Linux
478
adf6fe9bbc17 Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents: 398
diff changeset
5 confine { Facter::Core::Execution.which('iptables') }
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 setcode do
478
adf6fe9bbc17 Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents: 398
diff changeset
7 version = Facter::Core::Execution.execute('iptables --version', { on_fail: nil })
adf6fe9bbc17 Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents: 398
diff changeset
8 version.match(%r{\d+\.\d+\.\d+}).to_s if version
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 end
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 end