File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -856,6 +856,14 @@ Current it is only actively tested with the following operating systems:
856856
857857Although patches are welcome for making it work with other OS distros, it is considered best effort.
858858
859+ ### All versions of RHEL/Centos
860+
861+ If you have selinux enabled you must add any custom ports you use to the postgresql_port_t context. You can do this as follows:
862+
863+ ```
864+ # semanage port -a -t postgresql_port_t -p tcp $customport
865+ ```
866+
859867### RHEL7
860868
861869Currently the following features are unsupported:
Original file line number Diff line number Diff line change @@ -253,6 +253,27 @@ class { "postgresql::server":
253253 apply_manifest ( "class { 'postgresql::server': ensure => absent }" , :catch_failures => true )
254254 end
255255
256+ it 'sets up selinux' do
257+ pp = <<-EOS
258+ if $::osfamily == 'RedHat' and $::selinux == 'true' {
259+ $semanage_package = $::operatingsystemmajrelease ? {
260+ '5' => 'policycoreutils',
261+ default => 'policycoreutils-python',
262+ }
263+
264+ package { $semanage_package: ensure => installed }
265+ exec { 'set_postgres':
266+ command => 'semanage port -a -t postgresql_port_t -p tcp 5433',
267+ path => '/bin:/usr/bin/:/sbin:/usr/sbin',
268+ subscribe => Package[$semanage_package],
269+ refreshonly => true,
270+ }
271+ EOS
272+
273+ apply_manifest ( pp , :catch_failures => true )
274+ end
275+
276+
256277 context 'test installing postgresql with alternate port' do
257278 it 'perform installation and make sure it is idempotent' do
258279 pp = <<-EOS . unindent
You can’t perform that action at this time.
0 commit comments