summaryrefslogtreecommitdiff
path: root/playbooks.d/webserver-nginx/playbook.bash
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks.d/webserver-nginx/playbook.bash')
-rw-r--r--playbooks.d/webserver-nginx/playbook.bash11
1 files changed, 6 insertions, 5 deletions
diff --git a/playbooks.d/webserver-nginx/playbook.bash b/playbooks.d/webserver-nginx/playbook.bash
index 85c38be..b436018 100644
--- a/playbooks.d/webserver-nginx/playbook.bash
+++ b/playbooks.d/webserver-nginx/playbook.bash
@@ -5,14 +5,14 @@ playbook_add()
info "webserver/add" "Installing packages"
pkg install certbot nginx
- info "webserver/add" "Create www user"
- groupadd www
+ info "webserver/add" "Create nginx user account"
+ groupadd "$(config "nginx.group")"
useradd \
--home-dir /var/www \
- --gid www \
+ --gid "$(config "nginx.group")" \
--system \
--shell /sbin/nologin \
- www
+ "$(config "nginx.user")"
info "webserver/add" "Cleaning up whatever the package manager did"
rm -frv -- "$(config "fs.etcdir")/nginx"
@@ -47,6 +47,7 @@ playbook_sync()
notice "webserver/sync" "Updating nginx.conf"
file_template "nginx.conf" \
etc="$(config "fs.etcdir")" \
+ user="$(config "nginx.user")" \
> "$(config "fs.etcdir")/nginx/nginx.conf"
notice "webserver/sync" "Updating mime.types"
@@ -83,7 +84,7 @@ playbook_sync()
done
notice "webserver/sync" "Set nginx permissions to www user"
- chown -R www:www "$(config "fs.etcdir")/nginx"
+ chown -R "$(config "nginx.user"):$(config "nginx.group")" "$(config "fs.etcdir")/nginx"
notice "webserver/sync" "Renewing Let's Encrypt certificates"
certbot renew --no-random-sleep-on-renew