Skip to content

Commit 16ab79d

Browse files
committed
Removing Amazon from the list OSs that are grouped with Red Hat 7.
Red Hat 7 has diverged from the Amazon system architecture and Amazon uses a different versioning scheme. It's possible Amazon may re-align with Red Hat 7 in later releases. Additional logic may be required when that happens. Description: Adding an exception for Amazon as the conditions for RH7 were incorrectly catching Amazon because the version YYYY.MM will always evaluate to true
1 parent afe3359 commit 16ab79d

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

lib/puppet/util/firewall.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def persist_iptables(proto)
169169
end
170170

171171
# RHEL 7 and newer also use systemd to persist iptable rules
172-
if os_key == 'RedHat' && ['RedHat','CentOS','Scientific','SL','SLC','Ascendos','CloudLinux','PSBM','OracleLinux','OVS','OEL','Amazon','XenServer'].include?(Facter.value(:operatingsystem)) && Facter.value(:operatingsystemrelease).to_i >= 7
172+
if os_key == 'RedHat' && ['RedHat','CentOS','Scientific','SL','SLC','Ascendos','CloudLinux','PSBM','OracleLinux','OVS','OEL','XenServer'].include?(Facter.value(:operatingsystem)) && Facter.value(:operatingsystemrelease).to_i >= 7
173173
os_key = 'Fedora'
174174
end
175175

manifests/linux/redhat.pp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
# RHEL 7 and later and Fedora 15 and later require the iptables-services
2323
# package, which provides the /usr/libexec/iptables/iptables.init used by
2424
# lib/puppet/util/firewall.rb.
25-
if ($::operatingsystem != 'Fedora' and versioncmp($::operatingsystemrelease, '7.0') >= 0)
26-
or ($::operatingsystem == 'Fedora' and versioncmp($::operatingsystemrelease, '15') >= 0) {
25+
if ($::operatingsystem != 'Amazon')
26+
and (($::operatingsystem != 'Fedora' and versioncmp($::operatingsystemrelease, '7.0') >= 0)
27+
or ($::operatingsystem == 'Fedora' and versioncmp($::operatingsystemrelease, '15') >= 0)) {
2728
service { 'firewalld':
2829
ensure => stopped,
2930
enable => false,

manifests/params.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
case $::osfamily {
33
'RedHat': {
44
case $::operatingsystem {
5+
'Amazon': {
6+
$service_name = 'iptables'
7+
$package_name = undef
8+
}
59
'Archlinux': {
610
$service_name = ['iptables','ip6tables']
711
$package_name = undef

0 commit comments

Comments
 (0)