From 5e5f625b75e490a87d0b0bc466a68f45b5b4cb14 Mon Sep 17 00:00:00 2001 From: Trey Dockendorf Date: Thu, 25 Jan 2024 08:41:24 -0500 Subject: [PATCH] Fix Apache user for Ubuntu and Debian Replaces #148 --- data/os/Debian.yaml | 1 + manifests/init.pp | 3 +++ templates/sudo.erb | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/data/os/Debian.yaml b/data/os/Debian.yaml index d430af0..725004d 100644 --- a/data/os/Debian.yaml +++ b/data/os/Debian.yaml @@ -1,4 +1,5 @@ --- openondemand::repo_baseurl_prefix: https://apt.osc.edu/ondemand openondemand::repo_gpgkey: https://apt.osc.edu/ondemand/DEB-GPG-KEY-ondemand +openondemand::apache_user: www-data openondemand::logroot: /var/log/apache2 diff --git a/manifests/init.pp b/manifests/init.pp index a5b2178..eec563d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -30,6 +30,8 @@ # Hash of apps to install, passed to ondemand::install::app # @param declare_apache # Boolean that determines if apache is declared or included +# @param apache_user +# Name of the Apache user # @param apache_scls # SCLs to load when starting Apache service # @param generator_insecure @@ -253,6 +255,7 @@ # Apache Boolean $declare_apache = true, + String[1] $apache_user = 'apache', String $apache_scls = 'httpd24', # ood_portal.yml diff --git a/templates/sudo.erb b/templates/sudo.erb index abea252..ea748a4 100644 --- a/templates/sudo.erb +++ b/templates/sudo.erb @@ -1,5 +1,5 @@ -Defaults:apache !requiretty, !authenticate -Defaults:apache env_keep += "NGINX_STAGE_* OOD_*" -apache ALL=(ALL) NOPASSWD: <%= scope['openondemand::nginx_stage_cmd'] %> +Defaults:<%= scope['openondemand::apache_user'] %> !requiretty, !authenticate +Defaults:<%= scope['openondemand::apache_user'] %> env_keep += "NGINX_STAGE_* OOD_*" +<%= scope['openondemand::apache_user'] %> ALL=(ALL) NOPASSWD: <%= scope['openondemand::nginx_stage_cmd'] %> Cmnd_Alias KUBECTL = <%= scope['openondemand::kubectl_path'] %> Defaults!KUBECTL !syslog