diff --git a/ansible/roles/ncr-bip/tasks/install_bip.yml b/ansible/roles/ncr-bip/tasks/install_bip.yml index 90f7c477..4ce13347 100644 --- a/ansible/roles/ncr-bip/tasks/install_bip.yml +++ b/ansible/roles/ncr-bip/tasks/install_bip.yml @@ -61,7 +61,6 @@ group: binstall with_items: - "{{ sap_bip_installation_directory }}" - - "{{ sap_bip_archived_logs_directory }}" - "{{ sap_bip_responsefiles_directory }}" - block: diff --git a/ansible/roles/ncr-bip/tasks/main.yml b/ansible/roles/ncr-bip/tasks/main.yml index 40946c90..3d0209f4 100644 --- a/ansible/roles/ncr-bip/tasks/main.yml +++ b/ansible/roles/ncr-bip/tasks/main.yml @@ -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 diff --git a/ansible/roles/ncr-bip/tasks/setup_archived_logs.yml b/ansible/roles/ncr-bip/tasks/setup_archived_logs.yml new file mode 100644 index 00000000..613734f3 --- /dev/null +++ b/ansible/roles/ncr-bip/tasks/setup_archived_logs.yml @@ -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 diff --git a/ansible/roles/ncr-bip/tasks/setup_tomcat_restart.yml b/ansible/roles/ncr-bip/tasks/setup_tomcat_restart.yml index 49882df5..1f8ba82b 100644 --- a/ansible/roles/ncr-bip/tasks/setup_tomcat_restart.yml +++ b/ansible/roles/ncr-bip/tasks/setup_tomcat_restart.yml @@ -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 }}" @@ -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