File: ip6tables_version.rb

package info (click to toggle)
puppet-module-puppetlabs-firewall 8.1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 512 kB
  • sloc: ruby: 2,674; sh: 39; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 310 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

Facter.add(:ip6tables_version) do
  confine kernel: :Linux
  confine { Facter::Core::Execution.which('ip6tables') }
  setcode do
    version = Facter::Core::Execution.execute('ip6tables --version', { on_fail: nil })
    version.match(%r{\d+\.\d+\.\d+}).to_s if version
  end
end