From f61a443a90f13574f28b182e1df80267f8d5608a Mon Sep 17 00:00:00 2001 From: Matthew Wagoner Date: Mon, 8 Oct 2012 19:52:17 -0400 Subject: [PATCH] style edits to puppet config files Change-Id: I4f7314bcb1cb58f94ff7a78aebe27ec4591fc11c Reviewed-on: https://review.openstack.org/14187 Reviewed-by: Jeremy Stanley Reviewed-by: Clark Boylan Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins --- manifests/init.pp | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 5a9946c..f9527fc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,20 +1,20 @@ #http://projects.puppetlabs.com/projects/1/wiki/Module_Iptables_Patterns class iptables($rules='', $public_tcp_ports=[], $public_udp_ports=[]) { - package { - "iptables-persistent": ensure => present; + package { 'iptables-persistent': + ensure => present, } - service { "iptables-persistent": - require => Package["iptables-persistent"], + service { 'iptables-persistent': + require => Package['iptables-persistent'], # Because there is no running process for this service, the normal status # checks fail. Because puppet then thinks the service has been manually # stopped, it won't restart it. This fake status command will trick puppet # into thinking the service is *always* running (which in a way it is, as # iptables is part of the kernel.) - hasstatus => true, - status => "true", + hasstatus => true, + status => true, # Under Debian, the "restart" parameter does not reload the rules, so tell # Puppet to fall back to stop/start, which does work. @@ -22,32 +22,29 @@ class iptables($rules='', $public_tcp_ports=[], $public_udp_ports=[]) { } - file { "/etc/iptables": - ensure => directory + file { '/etc/iptables': + ensure => directory, } - file { - "/etc/iptables/rules": - owner => "root", - group => "root", - mode => 640, + file { '/etc/iptables/rules': + owner => 'root', + group => 'root', + mode => '0640', content => template('iptables/rules.erb'), - require => [Package["iptables-persistent"], File["/etc/iptables"]], + require => [Package['iptables-persistent'], File['/etc/iptables']], # When this file is updated, make sure the rules get reloaded. - notify => Service["iptables-persistent"], - ; + notify => Service['iptables-persistent'], } - file { - "/etc/iptables/rules.v4": - owner => "root", - group => "root", - mode => 640, - ensure => link, - target => "/etc/iptables/rules", - require => File["/etc/iptables/rules"], - notify => Service["iptables-persistent"] + file { '/etc/iptables/rules.v4': + ensure => link, + owner => 'root', + group => 'root', + mode => '0640', + target => '/etc/iptables/rules', + require => File['/etc/iptables/rules'], + notify => Service['iptables-persistent'], } }