Skip to content

Commit e93172e

Browse files
jaymzhfacebook-github-bot
authored andcommitted
fb_iptables: minor cleanups (facebook#304)
Differential Revision: D72411974 fbshipit-source-id: e3ac41b8888a196f21e014f3b6ec0354f8acda82
1 parent bdf99d2 commit e93172e

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

cookbooks/fb_iptables/files/default/fb_iptables_reload.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
# Licensed under the Apache License, Version 2.0 (the "License");
88
# you may not use this file except in compliance with the License.
99
# You may obtain a copy of the License at
10-
#
10+
#
1111
# http://www.apache.org/licenses/LICENSE-2.0
12-
#
12+
#
1313
# Unless required by applicable law or agreed to in writing, software
1414
# distributed under the License is distributed on an "AS IS" BASIS,
1515
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

cookbooks/fb_iptables/recipes/packages.rb

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,30 @@
1919
# limitations under the License.
2020
#
2121

22-
# c10s is opted out until EPEL 10 becomes available
23-
if (node.centos? && !(node.centos7? || node.centos8? || node.centos10?)) || node.fedora?
24-
packages = ['iptables-legacy']
22+
# In modern Fedora and C9 and above, iptables-nft contains everything
23+
# that iptables-legacy does, they overlap (with iptables-legacy being
24+
# a strict subset), and both packages 'providing' `iptables`
25+
#
26+
# In EL10/C10 and above, it's the same but iptables-nft
27+
# obsoletes iptables-services, so they cannot both be installed.
28+
if node.el_min_version?(9) || node.fedora?
29+
packages = ['iptables-nft']
2530
else
2631
packages = ['iptables']
2732
end
28-
if node.ubuntu?
33+
34+
if node.debian_family?
2935
packages << 'iptables-persistent'
36+
elsif node.el_min_version?(9)
37+
# In EL9/C9 and above, iptables-nft-services contains everything
38+
# that iptables-services does, they overlap.
39+
#
40+
# In EL10/C10 and above, it's the same but iptables-nft-services
41+
# obsoletes iptables-services
42+
#
43+
# In Fedora there is only 'iptables-services', and it's the
44+
# superset package (like iptables-nft-services in EL)
45+
packages << 'iptables-nft-services'
3046
else
3147
packages << 'iptables-services'
3248
end

0 commit comments

Comments
 (0)