Skip to content

Instantly share code, notes, and snippets.

@allen00se
Created May 9, 2016 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allen00se/7d1319b92d9211697d77f5c27e122582 to your computer and use it in GitHub Desktop.
Save allen00se/7d1319b92d9211697d77f5c27e122582 to your computer and use it in GitHub Desktop.
class firewalld {
package { 'firewalld':
ensure => present, # install package
}
# iptables service that comes with rhel/centos
service { 'iptables': # don't let this interfere
ensure => stopped, # ensure it's stopped
enable => false, # don't start on boot
}
service { 'ip6tables': # don't let this interfere
ensure => stopped, # ensure it's stopped
enable => false, # don't start on boot
}
service { 'firewalld':
ensure => running, # ensure it's running
enable => true, # start on boot
hasstatus => true, # init script has 'status' command
hasrestart => true, # init script has 'restart' command
require => [
Package['firewalld'],
File['/etc/firewalld/firewalld.conf'], # require this file
Service['iptables', 'ip6tables'], # ensure it's stopped
],
}
firewalld::service { 'nagios_nrpe':
short => 'Nagios_NRPE',
description => 'Nagios_NRPE',
ports => [{protocol => 'tcp', port => '5666',},],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment