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.bash12
1 files changed, 11 insertions, 1 deletions
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")" \