Skip to content

Commit e7ca1f9

Browse files
committed
feat: logrotate postgres logs
1 parent 9c0fef4 commit e7ca1f9

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

amazon-arm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"region": "ap-northeast-1",
66
"ami_regions": "us-east-1,eu-central-1,eu-west-1,eu-west-2,ap-south-1,ap-southeast-1,ap-southeast-2,us-west-1,us-east-1,ca-central-1,sa-east-1",
77
"ami": "ami-03345e027f391e3dc",
8-
"ami_name": "supabase-postgres-arm-0.14.1",
8+
"ami_name": "supabase-postgres-arm-0.14.2",
99
"environment": "prod",
1010
"ansible_arguments": "--skip-tags,update-only -v"
1111
},

ansible/files/logrotate-postgres

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/var/lib/postgresql/12/main/pg_log/postgresql.csv {
2+
daily
3+
size 50M
4+
rotate 3
5+
copytruncate
6+
delaycompress
7+
compress
8+
notifempty
9+
missingok
10+
}

ansible/playbook.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@
3737
state: enabled
3838
policy: deny
3939
direction: incoming
40-
40+
41+
- name: Setup logrotate for postgres logs
42+
copy:
43+
src: files/logrotate-postgres
44+
dest: /etc/logrotate.d/postgres
45+
4146
# Install EC2 instance connect
4247
# Only for AWS images
4348
- name: install EC2 instance connect

0 commit comments

Comments
 (0)