|
17 | 17 |
|
18 | 18 | if SELinuxDistroHelper.selinux_supported? |
19 | 19 | ssh_keygen_module = 'gitlab-7.2.0-ssh-keygen' |
20 | | - execute "semodule -i /opt/gitlab/embedded/selinux/#{ssh_keygen_module}.pp" do |
21 | | - not_if "getenforce | grep Disabled" |
22 | | - not_if "semodule -l | grep '^#{ssh_keygen_module}\\s'" |
23 | | - end |
24 | | - |
25 | 20 | authorized_keys_module = 'gitlab-10.5.0-ssh-authorized-keys' |
26 | | - execute "semodule -i /opt/gitlab/embedded/selinux/#{authorized_keys_module}.pp" do |
27 | | - not_if "getenforce | grep Disabled" |
28 | | - not_if "semodule -l | grep '^#{authorized_keys_module}\\s'" |
29 | | - end |
30 | | - |
31 | 21 | gitlab_shell_module = 'gitlab-13.5.0-gitlab-shell' |
32 | | - execute "semodule -i /opt/gitlab/embedded/selinux/#{gitlab_shell_module}.pp" do |
33 | | - not_if "getenforce | grep Disabled" |
34 | | - not_if "semodule -l | grep '^#{gitlab_shell_module}\\s'" |
| 22 | + gitlab_unified_module = 'gitlab' |
| 23 | + |
| 24 | + if SELinuxHelper.use_unified_policy?(node) |
| 25 | + execute "semodule -i /opt/gitlab/embedded/selinux/#{gitlab_unified_module}.pp" do |
| 26 | + not_if "getenforce | grep Disabled" |
| 27 | + not_if "semodule -l | grep -E '^#{gitlab_unified_module}([[:space:]]|$)'" |
| 28 | + end |
| 29 | + |
| 30 | + execute "semodule -r #{ssh_keygen_module}" do |
| 31 | + not_if "getenforce | grep Disabled" |
| 32 | + only_if "semodule -l | grep -E '^#{ssh_keygen_module}([[:space:]]|$)'" |
| 33 | + end |
| 34 | + |
| 35 | + execute "semodule -r #{authorized_keys_module}" do |
| 36 | + not_if "getenforce | grep Disabled" |
| 37 | + only_if "semodule -l | grep -E '^#{authorized_keys_module}([[:space:]]|$)'" |
| 38 | + end |
| 39 | + |
| 40 | + execute "semodule -r #{gitlab_shell_module}" do |
| 41 | + not_if "getenforce | grep Disabled" |
| 42 | + only_if "semodule -l | grep -E '^#{gitlab_shell_module}([[:space:]]|$)'" |
| 43 | + end |
| 44 | + else |
| 45 | + execute "semodule -i /opt/gitlab/embedded/selinux/#{ssh_keygen_module}.pp" do |
| 46 | + not_if "getenforce | grep Disabled" |
| 47 | + not_if "semodule -l | grep -E '^#{ssh_keygen_module}([[:space:]]|$)'" |
| 48 | + end |
| 49 | + |
| 50 | + execute "semodule -i /opt/gitlab/embedded/selinux/#{authorized_keys_module}.pp" do |
| 51 | + not_if "getenforce | grep Disabled" |
| 52 | + not_if "semodule -l | grep -E '^#{authorized_keys_module}([[:space:]]|$)'" |
| 53 | + end |
| 54 | + |
| 55 | + execute "semodule -i /opt/gitlab/embedded/selinux/#{gitlab_shell_module}.pp" do |
| 56 | + not_if "getenforce | grep Disabled" |
| 57 | + not_if "semodule -l | grep -E '^#{gitlab_shell_module}([[:space:]]|$)'" |
| 58 | + end |
| 59 | + |
| 60 | + execute "semodule -r #{gitlab_unified_module}" do |
| 61 | + not_if "getenforce | grep Disabled" |
| 62 | + only_if "semodule -l | grep -E '^#{gitlab_unified_module}([[:space:]]|$)'" |
| 63 | + end |
35 | 64 | end |
36 | 65 | end |
37 | 66 |
|
|
0 commit comments