From 351c5a89c0058240caa79908935c006e3e80dcc7 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 6 Jan 2021 18:00:09 +0100 Subject: [PATCH] Update to 2021-01-06 18:00 --- roles/grafana/tasks/main.yml | 1 + roles/httpd_common/tasks/main.yml | 4 ++++ roles/httpd_common/templates/logrotate.conf.j2 | 11 +++++++++++ roles/nginx/templates/logrotate.conf.j2 | 2 +- roles/squid/files/acl/software_various.domains | 3 +++ 5 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 roles/httpd_common/templates/logrotate.conf.j2 diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml index 3c11b81..b781276 100644 --- a/roles/grafana/tasks/main.yml +++ b/roles/grafana/tasks/main.yml @@ -36,6 +36,7 @@ - import_tasks: ../includes/get_rand_pass.yml vars: - pass_file: /etc/grafana/ansible_db_pass + - complex: False - set_fact: grafana_db_pass={{ rand_pass }} tags: grafana diff --git a/roles/httpd_common/tasks/main.yml b/roles/httpd_common/tasks/main.yml index fa18385..b6255fb 100644 --- a/roles/httpd_common/tasks/main.yml +++ b/roles/httpd_common/tasks/main.yml @@ -112,6 +112,10 @@ notify: reload httpd tags: [conf,web] +- name: Configure log rotation + template: src=logrotate.conf.j2 dest=/etc/logrotate.d/httpd + tags: [conf,web] + - name: Remove old iptables rule iptables_raw: name: httpd_port diff --git a/roles/httpd_common/templates/logrotate.conf.j2 b/roles/httpd_common/templates/logrotate.conf.j2 new file mode 100644 index 0000000..882f60c --- /dev/null +++ b/roles/httpd_common/templates/logrotate.conf.j2 @@ -0,0 +1,11 @@ +/var/log/httpd/*log { + daily + rotate 60 + missingok + notifempty + compress + sharedscripts + postrotate + /bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true + endscript +} diff --git a/roles/nginx/templates/logrotate.conf.j2 b/roles/nginx/templates/logrotate.conf.j2 index a4e4454..c0de701 100644 --- a/roles/nginx/templates/logrotate.conf.j2 +++ b/roles/nginx/templates/logrotate.conf.j2 @@ -1,7 +1,7 @@ /var/log/nginx/*log { create 0644 nginx nginx daily - rotate 10 + rotate 60 missingok notifempty compress diff --git a/roles/squid/files/acl/software_various.domains b/roles/squid/files/acl/software_various.domains index 3f77d92..961744e 100644 --- a/roles/squid/files/acl/software_various.domains +++ b/roles/squid/files/acl/software_various.domains @@ -47,6 +47,9 @@ forge.glpi-project.org # Chrome on Linux dl.google.com/linux/chrome +# Hosts several things, including the Zabbix datasource for Grafana +storage.googleapis.com + # Grafana repo grafanarel.s3.amazonaws.com packages.grafana.com