Merge "iptables on fedora"

This commit is contained in:
Jenkins 2014-08-29 17:57:27 +00:00 committed by Gerrit Code Review
commit e9283ed16a
3 changed files with 27 additions and 2 deletions

View File

@ -36,6 +36,7 @@ class iptables(
hasstatus => $::iptables::params::service_has_status, hasstatus => $::iptables::params::service_has_status,
status => $::iptables::params::service_status_cmd, status => $::iptables::params::service_status_cmd,
hasrestart => $::iptables::params::service_has_restart, hasrestart => $::iptables::params::service_has_restart,
enable => true,
} }
$notify_iptables = Service['iptables'] $notify_iptables = Service['iptables']
} }

View File

@ -5,14 +5,36 @@
class iptables::params { class iptables::params {
case $::osfamily { case $::osfamily {
'RedHat': { 'RedHat': {
$package_name = 'iptables' case $::operatingsystem {
'Fedora': {
$package_name = 'iptables-services'
$service_has_restart = true
}
'RedHat','CentOS','Scientific': {
case $::operatingsystemrelease {
/^7/: {
$package_name = 'iptables-services'
$service_has_restart = true
}
/^6/: {
$package_name = 'iptables'
$service_has_restart = false
}
default: {
fail("Unsupported operatingsystemrelease: ${::operatingsystemrelease} The 'iptables' module recognize only 6, 7 as RedHat major versions.")
}
}
}
default: {
fail("Unsupported operatingsystem: ${::operatingsystem} The 'iptables' module with RedHat osfamily.")
}
}
$service_name = 'iptables' $service_name = 'iptables'
$rules_dir = '/etc/sysconfig' $rules_dir = '/etc/sysconfig'
$ipv4_rules = '/etc/sysconfig/iptables' $ipv4_rules = '/etc/sysconfig/iptables'
$ipv6_rules = '/etc/sysconfig/ip6tables' $ipv6_rules = '/etc/sysconfig/ip6tables'
$service_has_status = true $service_has_status = true
$service_status_cmd = undef $service_status_cmd = undef
$service_has_restart = false
} }
'Debian': { 'Debian': {
$package_name = 'iptables-persistent' $package_name = 'iptables-persistent'

View File

@ -16,6 +16,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
export PATH=$PATH:/usr/local/sbin:/usr/sbin
for ip in `cat /etc/nodepool/primary_node /etc/nodepool/sub_nodes`; do for ip in `cat /etc/nodepool/primary_node /etc/nodepool/sub_nodes`; do
sudo iptables -I openstack-INPUT 1 -s $ip -j ACCEPT sudo iptables -I openstack-INPUT 1 -s $ip -j ACCEPT
done done