Skip to content

Commit 5320479

Browse files
committed
Remove firewall management
The firewall management really belongs outside of the module that manages postgresql, like in a profile.
1 parent 4b8b3aa commit 5320479

File tree

9 files changed

+1
-92
lines changed

9 files changed

+1
-92
lines changed

README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The PostgreSQL module allows you to easily manage postgres databases with Puppet
2626
Module Description
2727
-------------------
2828

29-
PostgreSQL is a high-performance, free, open-source relational database server. The postgresql module allows you to manage PostgreSQL packages and services on several operating systems, while also supporting basic management of PostgreSQL databases and users. The module offers support for managing firewall for postgres ports on RedHat-based distros, as well as support for basic management of common security settings.
29+
PostgreSQL is a high-performance, free, open-source relational database server. The postgresql module allows you to manage PostgreSQL packages and services on several operating systems, while also supporting basic management of PostgreSQL databases and users. The module offers support for basic management of common security settings.
3030

3131
Setup
3232
-----
@@ -35,7 +35,6 @@ Setup
3535

3636
* package/service/configuration files for PostgreSQL
3737
* listened-to ports
38-
* system firewall (optional)
3938
* IP and mask (optional)
4039

4140
**Introductory Questions**
@@ -44,7 +43,6 @@ The postgresql module offers many security configuration settings. Before gettin
4443

4544
* Do you want/need to allow remote connections?
4645
* If yes, what about TCP connections?
47-
* Would you prefer to work around your current firewall settings or overwrite some of them?
4846
* How restrictive do you want the database superuser's permissions to be?
4947

5048
Your answers to these questions will determine which of the module's parameters you'll want to specify values for.
@@ -71,7 +69,6 @@ For a more customized configuration:
7169
ip_mask_allow_all_users => '0.0.0.0/0',
7270
listen_addresses => '*',
7371
ipv4acls => ['hostssl all johndoe 192.168.0.0/24 cert'],
74-
manage_firewall => true,
7572
postgres_password => 'TPSrep0rt!',
7673
}
7774

@@ -376,9 +373,6 @@ This will set the default database locale for all databases created with this mo
376373

377374
On Debian you'll need to ensure that the 'locales-all' package is installed for full functionality of Postgres.
378375

379-
####`firewall_supported`
380-
This allows you to override the automated detection to see if your OS supports the `firewall` module.
381-
382376
####`manage_package_repo`
383377
If `true` this will setup the official PostgreSQL repositories on your host. Defaults to `false`.
384378

@@ -470,9 +464,6 @@ This will set the default database locale for all databases created with this mo
470464

471465
On Debian you'll need to ensure that the 'locales-all' package is installed for full functionality of Postgres.
472466

473-
####`manage_firewall`
474-
This value defaults to `false`. Many distros ship with a fairly restrictive firewall configuration which will block the port that postgres tries to listen on. If you'd like for the puppet module to open this port for you (using the [puppetlabs-firewall](http://forge.puppetlabs.com/puppetlabs/firewall) module), change this value to true. Check the documentation for `puppetlabs/firewall` to ensure the rest of the global setup is applied, to ensure things like persistence and global rules are set correctly.
475-
476467
####`manage_pg_hba_conf`
477468
This value defaults to `true`. Whether or not manage the pg_hba.conf. If set to `true`, puppet will overwrite this file. If set to `false`, puppet will not modify the file.
478469

manifests/globals.pp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@
4141
$encoding = undef,
4242
$locale = undef,
4343

44-
$manage_firewall = undef,
4544
$manage_pg_hba_conf = undef,
4645
$manage_pg_ident_conf = undef,
47-
$firewall_supported = undef,
4846

4947
$manage_package_repo = undef
5048
) {

manifests/params.pp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
$service_ensure = 'running'
1414
$service_enable = true
1515
$service_provider = $service_provider
16-
$manage_firewall = $manage_firewall
1716
$manage_pg_hba_conf = pick($manage_pg_hba_conf, true)
1817
$manage_pg_ident_conf = pick($manage_pg_ident_conf, true)
1918
$package_ensure = 'present'
@@ -24,7 +23,6 @@
2423
$user = pick($user, 'postgres')
2524
$group = pick($group, 'postgres')
2625
$needs_initdb = pick($needs_initdb, true)
27-
$firewall_supported = pick($firewall_supported, true)
2826
$version_parts = split($version, '[.]')
2927
$package_version = "${version_parts[0]}${version_parts[1]}"
3028

@@ -75,10 +73,6 @@
7573
}
7674

7775
'Archlinux': {
78-
# Based on the existing version of the firewall module, this is normally
79-
# true for Archlinux, but archlinux users want more control.
80-
# so they can set it themself
81-
$firewall_supported = pick($firewall_supported, true)
8276
$needs_initdb = pick($needs_initdb, true)
8377
$user = pick($user, 'postgres')
8478
$group = pick($group, 'postgres')
@@ -146,8 +140,6 @@
146140
$confdir = pick($confdir, "/etc/postgresql/${version}/main")
147141
$service_status = pick($service_status, "/etc/init.d/${service_name} status | /bin/egrep -q 'Running clusters: .+|online'")
148142
$psql_path = pick($psql_path, "/usr/bin/psql")
149-
150-
$firewall_supported = pick($firewall_supported, true)
151143
}
152144

153145
'FreeBSD': {
@@ -170,7 +162,6 @@
170162
$service_status = pick($service_status, "/usr/local/etc/rc.d/${service_name} status")
171163
$psql_path = pick($psql_path, "${bindir}/psql")
172164

173-
$firewall_supported = pick($firewall_supported, false)
174165
$needs_initdb = pick($needs_initdb, true)
175166
}
176167

@@ -194,15 +185,10 @@
194185
$service_status = pick($service_status, "/etc/init.d/${service_name} status")
195186
$psql_path = pick($psql_path, "${bindir}/psql")
196187

197-
$firewall_supported = pick($firewall_supported, false)
198188
$needs_initdb = pick($needs_initdb, true)
199189
}
200190

201191
default: {
202-
# Based on the existing version of the firewall module, this is normally
203-
# false for other OS, but this allows an escape hatch to override it.
204-
$firewall_supported = pick($firewall_supported, false)
205-
206192
$psql_path = pick($psql_path, "${bindir}/psql")
207193

208194
# Since we can't determine defaults on our own, we rely on users setting

manifests/server.pp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@
4242
$encoding = $postgresql::params::encoding,
4343
$locale = $postgresql::params::locale,
4444

45-
$manage_firewall = $postgresql::params::manage_firewall,
4645
$manage_pg_hba_conf = $postgresql::params::manage_pg_hba_conf,
4746
$manage_pg_ident_conf = $postgresql::params::manage_pg_ident_conf,
48-
$firewall_supported = $postgresql::params::firewall_supported,
4947

5048
#Deprecated
5149
$version = undef,
@@ -68,6 +66,5 @@
6866
class { "${pg}::config": }->
6967
class { "${pg}::service": }->
7068
class { "${pg}::passwd": }->
71-
class { "${pg}::firewall": }->
7269
anchor { "${pg}::end": }
7370
}

manifests/server/firewall.pp

Lines changed: 0 additions & 14 deletions
This file was deleted.

metadata.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@
7171
"name": "puppetlabs/stdlib",
7272
"version_requirement": "4.x"
7373
},
74-
{
75-
"name": "puppetlabs/firewall",
76-
"version_requirement": ">= 0.0.4"
77-
},
7874
{
7975
"name": "puppetlabs/apt",
8076
"version_requirement": ">=1.1.0 <2.0.0"

spec/acceptance/firewall_default_parameters_spec.rb

Lines changed: 0 additions & 32 deletions
This file was deleted.

spec/spec_helper_acceptance.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def psql(psql_cmd, user = 'postgres', exit_codes = [0,1], &block)
9797
end
9898

9999
on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
100-
on host, puppet('module','install','puppetlabs-firewall'), { :acceptable_exit_codes => [0,1] }
101100
on host, puppet('module','install','puppetlabs-apt'), { :acceptable_exit_codes => [0,1] }
102101
on host, puppet('module','install','puppetlabs-concat'), { :acceptable_exit_codes => [0,1] }
103102
end

spec/unit/classes/server_spec.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,6 @@
3939
end
4040
end
4141

42-
describe 'manage_firewall => true' do
43-
let(:params) do
44-
{
45-
:manage_firewall => true,
46-
}
47-
end
48-
49-
it 'should create firewall rule' do
50-
is_expected.to contain_firewall("5432 accept - postgres")
51-
end
52-
end
53-
5442
describe 'package_ensure => absent' do
5543
let(:params) do
5644
{

0 commit comments

Comments
 (0)