From 07adebb274d2546496104ade97cc36349537fde4 Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Wed, 8 May 2024 15:24:50 +0000 Subject: [PATCH 01/16] incorporated the logrotate, logstash and changed tenderdash_log to Trace --- ansible/group_vars/all | 2 +- ansible/roles/tenderdash/tasks/main.yml | 26 +++++++++++++++++++++++++ q | 12 ++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 q diff --git a/ansible/group_vars/all b/ansible/group_vars/all index 2a8e0a1a..b7bcea00 100644 --- a/ansible/group_vars/all +++ b/ansible/group_vars/all @@ -45,7 +45,7 @@ tendermint_rpc_port: 36657 tenderdash_uid: "100" tenderdash_gid: "1000" -tenderdash_log_level: debug +tenderdash_log_level: trace tenderdash_compose_project_name: tenderdash tenderdash_compose_path: '{{ dashd_home }}/{{ tenderdash_compose_project_name }}' diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 3821ae89..331bcfb0 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -50,3 +50,29 @@ state: present pull: always recreate: always + +- name: Configure logrotate for Tenderdash logs + copy: + dest: /etc/logrotate.d/tenderdash + content: | + {{ tenderdash_compose_path }}/tenderdash/logs/*.log { + daily + rotate 3 + compress + delaycompress + missingok + notifempty + create 640 tenderdash adm + } + when: tenderdash_network == 'testnet' + +- name: Add Logstash filter for Tenderdash TRACE logs + lineinfile: + path: /etc/logstash/conf.d/tenderdash.conf + line: | + filter { + if [log_level] == "TRACE" { + drop { } + } + } + when: tenderdash_network == 'testnet' \ No newline at end of file diff --git a/q b/q new file mode 100644 index 00000000..76050d9e --- /dev/null +++ b/q @@ -0,0 +1,12 @@ + Prometheus_metricbeats + cl-testnet-dashmate + elasticsearch_metricbeat_kibana + feat/load-test + feat/update-envoy + fix_firstrunconfig + fix_hproxy_config + fix_ssh +* logrotate_logstash + metricbeats + update_docker_compose + v1.0-dev From 283cda71bd5ba1a40b01b4ab724e4cbb6a25a7e2 Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Wed, 8 May 2024 15:32:44 +0000 Subject: [PATCH 02/16] small fix --- q | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 q diff --git a/q b/q deleted file mode 100644 index 76050d9e..00000000 --- a/q +++ /dev/null @@ -1,12 +0,0 @@ - Prometheus_metricbeats - cl-testnet-dashmate - elasticsearch_metricbeat_kibana - feat/load-test - feat/update-envoy - fix_firstrunconfig - fix_hproxy_config - fix_ssh -* logrotate_logstash - metricbeats - update_docker_compose - v1.0-dev From e40764cabe74b4f1181f8b6e3a7614f9bc5df295 Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Wed, 8 May 2024 15:35:05 +0000 Subject: [PATCH 03/16] small space fix --- ansible/roles/tenderdash/tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 331bcfb0..7b0f866f 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -75,4 +75,5 @@ drop { } } } - when: tenderdash_network == 'testnet' \ No newline at end of file + when: tenderdash_network == 'testnet' + \ No newline at end of file From a50d8d1ea955f33d1381e2bd8857ed722749a74b Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Wed, 8 May 2024 15:37:26 +0000 Subject: [PATCH 04/16] small fix --- ansible/roles/tenderdash/tasks/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 7b0f866f..5dd8fc58 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -76,4 +76,3 @@ } } when: tenderdash_network == 'testnet' - \ No newline at end of file From 0b661f9e3a853c80c4e29f8c2394c858db30a0ea Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Wed, 8 May 2024 15:41:46 +0000 Subject: [PATCH 05/16] fix3 --- ansible/roles/tenderdash/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 5dd8fc58..fbb8af36 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -52,7 +52,7 @@ recreate: always - name: Configure logrotate for Tenderdash logs - copy: + ansible.builtin.copy: dest: /etc/logrotate.d/tenderdash content: | {{ tenderdash_compose_path }}/tenderdash/logs/*.log { @@ -62,12 +62,12 @@ delaycompress missingok notifempty - create 640 tenderdash adm + create 0640 tenderdash adm } when: tenderdash_network == 'testnet' - name: Add Logstash filter for Tenderdash TRACE logs - lineinfile: + ansible.builtin.lineinfile: path: /etc/logstash/conf.d/tenderdash.conf line: | filter { From 2816486d7550c0630366fa33ff8ab49e328356e9 Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Wed, 8 May 2024 15:55:20 +0000 Subject: [PATCH 06/16] fix3 --- ansible/roles/tenderdash/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index fbb8af36..a1087536 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -62,7 +62,7 @@ delaycompress missingok notifempty - create 0640 tenderdash adm + create 0644 tenderdash adm } when: tenderdash_network == 'testnet' From ff3fd3c7e204abacadcc71c6191c41e9ec0148f2 Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Wed, 8 May 2024 16:03:14 +0000 Subject: [PATCH 07/16] fix4 --- ansible/roles/tenderdash/tasks/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index a1087536..37b4a87d 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -52,7 +52,7 @@ recreate: always - name: Configure logrotate for Tenderdash logs - ansible.builtin.copy: + copy: dest: /etc/logrotate.d/tenderdash content: | {{ tenderdash_compose_path }}/tenderdash/logs/*.log { @@ -62,8 +62,9 @@ delaycompress missingok notifempty - create 0644 tenderdash adm + create 0644 tenderdash adm # Ensure correct permissions } + mode: '0644' # Explicitly set the file mode for the task when: tenderdash_network == 'testnet' - name: Add Logstash filter for Tenderdash TRACE logs From f1f41fb05cd8c6e0fdd4d8d433e14e3cc5d32fa5 Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Wed, 8 May 2024 16:06:00 +0000 Subject: [PATCH 08/16] fix --- ansible/roles/tenderdash/tasks/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 37b4a87d..08d3b91c 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -62,9 +62,8 @@ delaycompress missingok notifempty - create 0644 tenderdash adm # Ensure correct permissions + create 0640 tenderdash adm } - mode: '0644' # Explicitly set the file mode for the task when: tenderdash_network == 'testnet' - name: Add Logstash filter for Tenderdash TRACE logs From 784790f00f8d83f56d79762fe343b1d8b2bf2b37 Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Wed, 8 May 2024 16:12:37 +0000 Subject: [PATCH 09/16] ignoring risky permissions --- ansible/.ansible-lint | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ansible/.ansible-lint diff --git a/ansible/.ansible-lint b/ansible/.ansible-lint new file mode 100644 index 00000000..e15c3cf9 --- /dev/null +++ b/ansible/.ansible-lint @@ -0,0 +1,2 @@ +skip_list: + - 'risky-file-permissions' From a42a2046a9e48fea79de359e62dc9e89414e6fc1 Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Wed, 8 May 2024 16:16:33 +0000 Subject: [PATCH 10/16] fix --- ansible/.ansible-lint | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 ansible/.ansible-lint diff --git a/ansible/.ansible-lint b/ansible/.ansible-lint deleted file mode 100644 index e15c3cf9..00000000 --- a/ansible/.ansible-lint +++ /dev/null @@ -1,2 +0,0 @@ -skip_list: - - 'risky-file-permissions' From 6dfe61354d44238f6f72aca6512f0653d3ed7af5 Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Thu, 9 May 2024 06:34:30 +0000 Subject: [PATCH 11/16] changed permission to 600 --- ansible/roles/tenderdash/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 08d3b91c..1bb75a53 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -62,7 +62,7 @@ delaycompress missingok notifempty - create 0640 tenderdash adm + create 0600 tenderdash } when: tenderdash_network == 'testnet' From 3a7004b665710e7e434b08ea1fb0a9c4fb304e36 Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Thu, 9 May 2024 06:37:15 +0000 Subject: [PATCH 12/16] fix --- ansible/roles/tenderdash/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 1bb75a53..761eec19 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -62,7 +62,7 @@ delaycompress missingok notifempty - create 0600 tenderdash + create 0600 tenderdash } when: tenderdash_network == 'testnet' From 1c4470019934a5df0652f353c240e9663932f34d Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Thu, 9 May 2024 07:00:14 +0000 Subject: [PATCH 13/16] changing to 0644 --- ansible/roles/tenderdash/tasks/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 761eec19..33221885 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -52,7 +52,7 @@ recreate: always - name: Configure logrotate for Tenderdash logs - copy: + ansible.builtin.copy: dest: /etc/logrotate.d/tenderdash content: | {{ tenderdash_compose_path }}/tenderdash/logs/*.log { @@ -62,8 +62,11 @@ delaycompress missingok notifempty - create 0600 tenderdash + create 0644 {{ tenderdash_uid }} {{ tenderdash_gid }} } + owner: '{{ tenderdash_uid }}' + group: '{{ tenderdash_gid }}' + mode: '0644' when: tenderdash_network == 'testnet' - name: Add Logstash filter for Tenderdash TRACE logs From d05602b6a5907caeb97984072712ac01867bbaae Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Thu, 9 May 2024 07:03:08 +0000 Subject: [PATCH 14/16] small fix --- ansible/roles/tenderdash/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 33221885..16d72ccf 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -62,11 +62,11 @@ delaycompress missingok notifempty - create 0644 {{ tenderdash_uid }} {{ tenderdash_gid }} + create 0644 {{ tenderdash_uid }} {{ tenderdash_gid }} } - owner: '{{ tenderdash_uid }}' + owner: '{{ tenderdash_uid }}' group: '{{ tenderdash_gid }}' - mode: '0644' + mode: '0644' when: tenderdash_network == 'testnet' - name: Add Logstash filter for Tenderdash TRACE logs From c15c05a78c7431042429e61e14b53109f8f8a4be Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Thu, 9 May 2024 07:11:26 +0000 Subject: [PATCH 15/16] fix --- ansible/roles/tenderdash/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 16d72ccf..4b0a2796 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -65,7 +65,7 @@ create 0644 {{ tenderdash_uid }} {{ tenderdash_gid }} } owner: '{{ tenderdash_uid }}' - group: '{{ tenderdash_gid }}' + group: '{{ tenderdash_gid }}' mode: '0644' when: tenderdash_network == 'testnet' From fb2102fcd0b48735233963487e370e5d097b730d Mon Sep 17 00:00:00 2001 From: vivekgsharma Date: Thu, 9 May 2024 13:26:53 +0000 Subject: [PATCH 16/16] incorporated lukas comments , changed to 640 --- ansible/roles/tenderdash/tasks/main.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ansible/roles/tenderdash/tasks/main.yml b/ansible/roles/tenderdash/tasks/main.yml index 4b0a2796..7ee27974 100644 --- a/ansible/roles/tenderdash/tasks/main.yml +++ b/ansible/roles/tenderdash/tasks/main.yml @@ -57,25 +57,23 @@ content: | {{ tenderdash_compose_path }}/tenderdash/logs/*.log { daily - rotate 3 + rotate 1 compress delaycompress missingok notifempty - create 0644 {{ tenderdash_uid }} {{ tenderdash_gid }} + create 0640 {{ tenderdash_uid }} {{ tenderdash_gid }} } owner: '{{ tenderdash_uid }}' group: '{{ tenderdash_gid }}' - mode: '0644' - when: tenderdash_network == 'testnet' + mode: '0640' - name: Add Logstash filter for Tenderdash TRACE logs ansible.builtin.lineinfile: path: /etc/logstash/conf.d/tenderdash.conf line: | filter { - if [log_level] == "TRACE" { + if [log_level] == "trace" { drop { } } } - when: tenderdash_network == 'testnet'