Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Pass 'manage_redhat_firewall' param through to postgres

Prior to this commit, if you allowed the puppetdb module
to manage postgres for you, it would always try to manage
the firewall for the postgres port on redhat systems.

This commit exposes that as a parameter in a few more
spots, and passes it through to the postgres module.
  • Loading branch information...
commit f21740b69917233bb12a784a14c34bdd675ae5ab 1 parent 79f9190
Chris Price authored September 21, 2012
2  Modulefile
... ...
@@ -1,5 +1,5 @@
1 1
 name 'puppetlabs-puppetdb'
2  
-version '1.0.1'
  2
+version '1.0.3'
3 3
 source 'git://github.com/puppetlabs-puppet/puppetlabs-puppetdb.git'
4 4
 author 'Puppet Labs'
5 5
 description 'PuppetDB resource types'
2  README.md
Source Rendered
@@ -3,7 +3,7 @@ puppetlabs-puppetdb
3 3
 
4 4
 Purpose:	    Install and manage the PuppetDB server and database, and
5 5
                 configure the Puppet master to use PuppetDB
6  
-Module:	        puppetlabs/puppetdb (http://forge.puppetlabs.com/cprice404/puppetdb)
  6
+Module:	        puppetlabs/puppetdb (http://forge.puppetlabs.com/puppetlabs/puppetdb)
7 7
 Puppet Version:	2.7+
8 8
 Platforms:	    RHEL6, Debian6, Ubuntu 10.04
9 9
 
5  manifests/database/postgresql.pp
@@ -33,7 +33,8 @@
33 33
 #
34 34
 class puppetdb::database::postgresql(
35 35
   # TODO: expose more of the parameters from `inkling/postgresql`!
36  
-  $listen_addresses = $puppetdb::params::database_host,
  36
+  $listen_addresses       = $puppetdb::params::database_host,
  37
+  $manage_redhat_firewall = $puppetdb::params::manage_redhat_firewall,
37 38
 ) inherits puppetdb::params {
38 39
 
39 40
   # get the pg server up and running
@@ -42,7 +43,7 @@
42 43
       # TODO: make this stuff configurable
43 44
       'ip_mask_allow_all_users' => '0.0.0.0/0',
44 45
       'listen_addresses'        => $listen_addresses,
45  
-      'manage_redhat_firewall'  => true,
  46
+      'manage_redhat_firewall'  => $manage_redhat_firewall,
46 47
     },
47 48
   }
48 49
 
13  manifests/init.pp
@@ -38,18 +38,21 @@
38 38
 # TODO: expose more parameters
39 39
 #
40 40
 class puppetdb(
41  
-  $database         = $puppetdb::params::database,
42  
-  $puppetdb_version = $puppetdb::params::puppetdb_version,
  41
+  $database               = $puppetdb::params::database,
  42
+  $puppetdb_version       = $puppetdb::params::puppetdb_version,
  43
+  $manage_redhat_firewall = $puppetdb::params::manage_redhat_firewall,
43 44
 ) inherits puppetdb::params {
44 45
 
45 46
   class { 'puppetdb::server':
46  
-    database         => $database,
47  
-    puppetdb_version => $puppetdb_version,
  47
+    database               => $database,
  48
+    puppetdb_version       => $puppetdb_version,
  49
+    manage_redhat_firewall => $manage_redhat_firewall,
48 50
   }
49 51
 
50 52
   if ($database == 'postgres') {
51 53
     class { 'puppetdb::database::postgresql':
52  
-      before => Class['puppetdb::server']
  54
+      manage_redhat_firewall => $manage_redhat_firewall,
  55
+      before                 => Class['puppetdb::server']
53 56
     }
54 57
   }
55 58
 }
4  manifests/server/firewall.pp
@@ -7,13 +7,13 @@
7 7
   # TODO: the firewall module should be able to handle this itself
8 8
   if ($manage_redhat_firewall and $puppetdb::params::firewall_supported) {
9 9
 
10  
-    exec { 'persist-firewall':
  10
+    exec { 'puppetdb-persist-firewall':
11 11
       command     => $puppetdb::params::persist_firewall_command,
12 12
       refreshonly => true,
13 13
     }
14 14
 
15 15
     Firewall {
16  
-      notify => Exec['persist-firewall']
  16
+      notify => Exec['puppetdb-persist-firewall']
17 17
     }
18 18
 
19 19
     firewall { "${port} accept - puppetdb":

0 notes on commit f21740b

Please sign in to comment.
Something went wrong with that request. Please try again.