root / lib / facter / nftables.rb @ 03d9e7da
Historique | Voir | Annoter | Télécharger (469 octets)
1 |
#
|
---|---|
2 |
# Produce an array of nftables.
|
3 |
# nft list tables
|
4 |
# table inet filter
|
5 |
# table ip nat
|
6 |
# table ip6 nat
|
7 |
# table inet f2b-table
|
8 |
#
|
9 |
Facter.add(:nftables) do |
10 |
@nft_cmd = Facter::Util::Resolution.which('nft') |
11 |
confine { @nft_cmd }
|
12 |
|
13 |
setcode do
|
14 |
tables = [] |
15 |
table_result = Facter::Core::Execution.execute(%(#{@nft_cmd} list tables)) |
16 |
table_result.each_line do |line|
|
17 |
tables.push(line.split(' ')[1, 2].join('-')) |
18 |
end
|
19 |
{ 'tables' => tables }
|
20 |
end
|
21 |
end
|