Merge "Fix logic in selinux execs"
This commit is contained in:
@@ -28,28 +28,26 @@ class cgit::selinux {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exec { 'cgit_allow_http_port':
|
exec { 'cgit_allow_http_port':
|
||||||
# If we cannot add the rule modify the existing rule.
|
unless => "semanage port -l | grep \'http_port_t.*tcp.*${::cgit::http_port}\'",
|
||||||
onlyif => "bash -c \'! semanage port -a -t http_port_t -p tcp ${::cgit::http_port}\'",
|
command => "semanage port -a -t http_port_t -p tcp ${::cgit::http_port} \
|
||||||
command => "semanage port -m -t http_port_t -p tcp ${::cgit::http_port}",
|
|| semanage port -m -t http_port_t -p tcp ${::cgit::http_port}",
|
||||||
path => '/bin:/usr/sbin',
|
path => '/bin:/usr/sbin',
|
||||||
before => Service['httpd'],
|
before => Service['httpd'],
|
||||||
subscribe => File['/etc/httpd/conf/httpd.conf'],
|
subscribe => File['/etc/httpd/conf/httpd.conf'],
|
||||||
refreshonly => true,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'cgit_allow_https_port':
|
exec { 'cgit_allow_https_port':
|
||||||
# If we cannot add the rule modify the existing rule.
|
unless => "semanage port -l | grep \'http_port_t.*tcp.*${::cgit::https_port}\'",
|
||||||
onlyif => "bash -c \'! semanage port -a -t http_port_t -p tcp ${::cgit::https_port}\'",
|
command => "semanage port -a -t http_port_t -p tcp ${::cgit::https_port} \
|
||||||
command => "semanage port -m -t http_port_t -p tcp ${::cgit::https_port}",
|
|| semanage port -m -t http_port_t -p tcp ${::cgit::https_port}",
|
||||||
path => '/bin:/usr/sbin',
|
path => '/bin:/usr/sbin',
|
||||||
subscribe => File['/etc/httpd/conf.d/ssl.conf'],
|
subscribe => File['/etc/httpd/conf.d/ssl.conf'],
|
||||||
refreshonly => true,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'cgit_allow_git_daemon_port':
|
exec { 'cgit_allow_git_daemon_port':
|
||||||
# If we cannot add the rule modify the existing rule.
|
unless => "semanage port -l | grep \'git_port_t.*tcp.*${::cgit::daemon_port}\'",
|
||||||
onlyif => "bash -c \'! semanage port -a -t git_port_t -p tcp ${::cgit::daemon_port}\'",
|
command => "semanage port -a -t git_port_t -p tcp ${::cgit::daemon_port} \
|
||||||
command => "semanage port -m -t git_port_t -p tcp ${::cgit::daemon_port}",
|
|| semanage port -m -t git_port_t -p tcp ${::cgit::daemon_port}",
|
||||||
path => '/bin:/usr/sbin',
|
path => '/bin:/usr/sbin',
|
||||||
before => Service[$::cgit::git_daemon_service_name],
|
before => Service[$::cgit::git_daemon_service_name],
|
||||||
subscribe => [
|
subscribe => [
|
||||||
|
|||||||
Reference in New Issue
Block a user