view modules/firewall/lib/facter/iptables_version.rb @ 275:d9352a684e62

Mass update of modules to remove deprecation warnings
author IBBoard <dev@ibboard.co.uk>
date Sun, 26 Jan 2020 11:36:07 +0000
parents d6f2a0ee45c0
children 66c406eec60d
line wrap: on
line source

Facter.add(:iptables_version) do
  confine kernel: :Linux
  setcode do
    version = Facter::Util::Resolution.exec('iptables --version')
    if version
      version.match(%r{\d+\.\d+\.\d+}).to_s
    else
      nil
    end
  end
end