From 2d402273b67d72e3c1cc84ad952151568bb8ac3c Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Fri, 6 May 2022 10:01:53 +0200 Subject: Add logrotate configuration for nginx --- playbooks.d/webserver-nginx/playbook.bash | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'playbooks.d/webserver-nginx/playbook.bash') diff --git a/playbooks.d/webserver-nginx/playbook.bash b/playbooks.d/webserver-nginx/playbook.bash index b436018..e750eb6 100644 --- a/playbooks.d/webserver-nginx/playbook.bash +++ b/playbooks.d/webserver-nginx/playbook.bash @@ -3,7 +3,10 @@ playbook_add() { info "webserver/add" "Installing packages" - pkg install certbot nginx + pkg install \ + certbot \ + logrotate \ + nginx info "webserver/add" "Create nginx user account" groupadd "$(config "nginx.group")" @@ -27,6 +30,7 @@ playbook_add() "$(config "fs.etcdir")/nginx/sites-enabled.d/http" \ "$(config "fs.etcdir")/nginx/sites-enabled.d/https" \ "$(config "fs.etcdir")/nginx/snippets.d" \ + "$(config "fs.logdir")/nginx/access-logs" \ /var/www info "webserver/add" "Generating dhparam.pem" @@ -44,6 +48,12 @@ playbook_sync() local snippets local sites + notice "$BASHTARD_PLAYBOOK" "Updating logrotate" + file_template "logrotate.conf" \ + user="$(config "nginx.user")" \ + group="$(config "nginx.group")" \ + > "$(config "fs.etcdir")/logrotate.d/nginx" + notice "webserver/sync" "Updating nginx.conf" file_template "nginx.conf" \ etc="$(config "fs.etcdir")" \ -- cgit v1.1