Mercurial > repos > other > Puppet
annotate modules/firewall/lib/facter/ip6tables_version.rb @ 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 |
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(:ip6tables_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 |
39 | 5 setcode do |
6 version = Facter::Util::Resolution.exec('ip6tables --version') | |
7 if version | |
275
d9352a684e62
Mass update of modules to remove deprecation warnings
IBBoard <dev@ibboard.co.uk>
parents:
39
diff
changeset
|
8 version.match(%r{\d+\.\d+\.\d+}).to_s |
39 | 9 else |
10 nil | |
11 end | |
12 end | |
13 end |