Skip to content

Commit 957fc61

Browse files
committed
Feature: Make selboolean management optional
1 parent 2dc5e7d commit 957fc61

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

manifests/config.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
keycloak => $foreman::keycloak,
139139
keycloak_app_name => $foreman::keycloak_app_name,
140140
keycloak_realm => $foreman::keycloak_realm,
141+
manage_selinux => $foreman::manage_selinux,
141142
}
142143

143144
contain foreman::config::apache

manifests/config/apache.pp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
# @param keycloak_realm
9999
# The realm as passed to keycloak-httpd-client-install
100100
#
101+
# @param manage_selinux
102+
# If true AND selinux is enabled on the node, set httpd_can_network_connect so apache works properly
103+
#
101104
class foreman::config::apache(
102105
Stdlib::Absolutepath $app_root = '/usr/share/foreman',
103106
String $priority = '05',
@@ -131,6 +134,7 @@
131134
Boolean $keycloak = false,
132135
String[1] $keycloak_app_name = 'foreman-openidc',
133136
String[1] $keycloak_realm = 'ssl-realm',
137+
Boolean $manage_selinux = true,
134138
) {
135139
$docroot = "${app_root}/public"
136140

@@ -222,7 +226,7 @@
222226
],
223227
}
224228

225-
if $facts['os']['selinux']['enabled'] {
229+
if $facts['os']['selinux']['enabled'] and $manage_selinux {
226230
selboolean { 'httpd_can_network_connect':
227231
persistent => true,
228232
value => 'on',

manifests/init.pp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@
198198
#
199199
# $rails_cache_store:: Set rails cache store
200200
#
201+
# $param manage_selinux: If true AND selinux is enabled on the node, set httpd_can_network_connect so apache works properly##
202+
#
201203
# === Keycloak parameters:
202204
#
203205
# $keycloak:: Enable Keycloak support. Note this is limited
@@ -207,7 +209,6 @@
207209
# $keycloak_app_name:: The app name as passed to keycloak-httpd-client-install
208210
#
209211
# $keycloak_realm:: The realm as passed to keycloak-httpd-client-install
210-
#
211212
class foreman (
212213
Stdlib::HTTPUrl $foreman_url = $foreman::params::foreman_url,
213214
Boolean $unattended = $foreman::params::unattended,
@@ -307,6 +308,7 @@
307308
Boolean $keycloak = $foreman::params::keycloak,
308309
String[1] $keycloak_app_name = $foreman::params::keycloak_app_name,
309310
String[1] $keycloak_realm = $foreman::params::keycloak_realm,
311+
Boolean $manage_selinux = false,
310312
) inherits foreman::params {
311313
if $db_sslmode == 'UNSET' and $db_root_cert {
312314
$db_sslmode_real = 'verify-full'

0 commit comments

Comments
 (0)