Enable traefik access log and log rotation
This commit is contained in:
parent
66215952ee
commit
e7270d1f7a
4 changed files with 33 additions and 1 deletions
|
|
@ -18,6 +18,22 @@
|
|||
delete: true # Remove retired containers
|
||||
- name: Reload systemd generators
|
||||
ansible.builtin.command: sudo systemctl daemon-reload
|
||||
- name: Install logrotate
|
||||
ansible.builtin.package:
|
||||
name: logrotate
|
||||
state: present
|
||||
- name: Copy logrotate config
|
||||
ansible.posix.synchronize:
|
||||
src: ../logrotate.d/
|
||||
dest: /etc/logrotate.d
|
||||
- name: find files with possible suspect line endings
|
||||
ansible.builtin.find:
|
||||
paths: /etc/logrotate.d
|
||||
patterns: '*'
|
||||
register: output
|
||||
- name: fix suspect line endings
|
||||
replace: path={{item.path}} regexp="\r"
|
||||
with_items: "{{ output.files }}"
|
||||
- name: Copy traefik config
|
||||
ansible.posix.synchronize:
|
||||
src: ../traefik/
|
||||
|
|
@ -26,6 +42,10 @@
|
|||
file:
|
||||
path: /var/srv/traefik
|
||||
state: directory
|
||||
- name: Creates traefik log directory
|
||||
file:
|
||||
path: /var/log/traefik
|
||||
state: directory
|
||||
- name: Copy kanidm config
|
||||
ansible.posix.synchronize:
|
||||
src: ../kanidm/
|
||||
|
|
@ -99,7 +119,6 @@
|
|||
path: /var/opt/autokuma
|
||||
state: directory
|
||||
|
||||
|
||||
# - name: install linux-system-roles
|
||||
# package:
|
||||
# name: linux-system-roles
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ Volume=/run/podman/podman.sock:/var/run/docker.sock:z
|
|||
Volume=/etc/localtime:/etc/localtime:ro
|
||||
Volume=/var/srv/traefik:/certificates:z
|
||||
Volume=/etc/traefik:/etc/traefik:ro,z
|
||||
Volume=/var/log/traefik:/var/log/traefik:z
|
||||
Volume=kanidm-certs.volume:/kanidm_certs:ro,z
|
||||
|
||||
# Volume=/var/srv/matrix/caddy/config:/config:z
|
||||
|
|
|
|||
9
servers/logrotate.d/traefik.conf
Normal file
9
servers/logrotate.d/traefik.conf
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
/var/log/traefik/* {
|
||||
missingok
|
||||
notifempty
|
||||
weekly
|
||||
rotate 3
|
||||
size 10M
|
||||
compress
|
||||
delaycompress
|
||||
}
|
||||
|
|
@ -2,6 +2,9 @@ global:
|
|||
checkNewVersion: false
|
||||
log:
|
||||
level: INFO
|
||||
accessLog:
|
||||
filePath: "/var/log/traefik/access.log"
|
||||
bufferingSize: 100
|
||||
providers:
|
||||
docker:
|
||||
exposedbydefault: false
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue