Skip to content

Commit

Permalink
nomis reporting: log cleanup improvement (#1177)
Browse files Browse the repository at this point in the history
* allow different sap_bip_rar_base per environment

* remove archive log tasks

* add separate step for setting up archived logs

* -
  • Loading branch information
drobinson-moj authored Dec 18, 2024
1 parent 8936a57 commit 9ea7590
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
1 change: 0 additions & 1 deletion ansible/roles/ncr-bip/tasks/install_bip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
group: binstall
with_items:
- "{{ sap_bip_installation_directory }}"
- "{{ sap_bip_archived_logs_directory }}"
- "{{ sap_bip_responsefiles_directory }}"

- block:
Expand Down
5 changes: 5 additions & 0 deletions ansible/roles/ncr-bip/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
- ncr_bip_setup_provisioning
- ncr_bip_redeploy_tomcat

- import_tasks: setup_archived_logs.yml
tags:
- ec2provision
- ncr_bip_setup_archived_logs

- import_tasks: install_bip.yml
tags:
- ec2provision
Expand Down
19 changes: 19 additions & 0 deletions ansible/roles/ncr-bip/tasks/setup_archived_logs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
- name: Create archived log directory
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0775
owner: bobj
group: binstall
with_items:
- "{{ sap_bip_archived_logs_directory }}"

- name: Setup archived log cleanup cron
ansible.builtin.cron:
name: "log_cleanup"
minute: "0"
hour: "3"
weekday: "MON,WED,FRI"
job: "find {{ sap_bip_archived_logs_directory }} -mtime +365 -prune -exec rm -rf {} \\;"
user: bobj
18 changes: 0 additions & 18 deletions ansible/roles/ncr-bip/tasks/setup_tomcat_restart.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
---
- block:
- name: Create web only directories
ansible.builtin.file:
path: "{{ item }}"
owner: bobj
group: binstall
state: directory
loop:
- "{{ sap_bip_archived_logs_directory }}"

- name: Copy tomcat restart script
ansible.builtin.template:
src: "{{ item }}"
Expand All @@ -28,14 +19,5 @@
job: "/home/bobj/tomcat_restart.sh"
user: bobj

- name: Setup log cleanup cron
ansible.builtin.cron:
name: "log_cleanup"
minute: "0"
hour: "3"
weekday: "MON,WED,FRI"
job: "find {{ sap_bip_archived_logs_directory }} -mtime +365 -prune -exec rm -rf {} \\;"
user: bobj

# block
when: sap_web_apps is defined

0 comments on commit 9ea7590

Please sign in to comment.