Skip to content

Commit

Permalink
Merge pull request #576 from ministryofjustice/csr_training_schema_re…
Browse files Browse the repository at this point in the history
…fresh

Updated to include the new scripts for refresh
  • Loading branch information
Sandhya1874 authored Feb 28, 2024
2 parents 5f62c1d + 91068f9 commit 7138ebc
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,14 @@ db_configs:
- { name: IWFM_TAF, role: PRIMARY }

db_sid: PPIWFM
refresh_script: csr_training_schema_refresh.sh
refresh_script: csr_weekly_training_schema_refresh.sh
iwfm_train_dumpfile: iwfm_train3_05012024.dmp
train_custom_dumpfile: train_custom3_05012024.dmp
training_schema_refresh_cron:
iwfm_train_refresh:
- name: iwfm_train_refresh
weekday: "6"
minute: "00"
hour: "06"
dump_file: iwfm_train3_06042023.dmp
source_schema: iwfm_train3
target_schema: iwfm_train4
train_custom_refresh:
- name: train_custom_refresh
weekday: "6"
minute: "00"
hour: "06"
dump_file: train_custom3_06042023.dmp
source_schema: train_custom3
target_schema: train_custom4
- name: iwfm_train_custom_refresh
weekday: "6"
minute: "00"
hour: "06"

# Oracle database housekeeping
audit_housekeeping_period: 60
Expand All @@ -82,4 +72,3 @@ housekeeping_cron:
weekday: "0"
minute: "30"
hour: "08"
# job: command generated in
4 changes: 2 additions & 2 deletions ansible/roles/csr-preprod-refresh/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
s3_bucket: s3-bucket20230609110811735400000001/CSR_DB_REFRESH
refresh_script: "csr_training_schema_refresh.sh"
adhoc_refresh_script: "csr_preprod_refresh_from_prod.sh"
refresh_script: "csr_weekly_training_schema_refresh.sh"
adhoc_refresh_script: "preprod_adhoc_db_schemas_import.sh"
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
---
- name: create script directory
ansible.builtin.file:
path: "{{ item }}"
Expand Down
17 changes: 4 additions & 13 deletions ansible/roles/csr-preprod-refresh/tasks/csr-training-refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,16 @@
loop:
- "{{ refresh_script }}"
- "{{ adhoc_refresh_script }}"
- "csr_schema_refresh.sh"
- "csr_training_schema_export.sh"
- "preprod_adhoc_db_schemas_import.sh"

- name: setup iwfm_train schema refresh
- name: setup iwfm_train3-4 & train_custom3-4 schema refresh
ansible.builtin.cron:
name: "{{ item.name }}"
weekday: "{{ item.weekday }}"
minute: "{{ item.minute }}"
hour: "{{ item.hour }}"
user: root
job: "su oracle -c '/home/oracle/admin/scripts/{{ refresh_script }} -i {{ db_sid }} -d refresh_dump_dir -f {{ item.dump_file }} -t '{{ item.target_schema }}' -s {{ item.source_schema }}' 2>&1 | logger -p local3.info -t iwfm_train_refresh"
loop: "{{ training_schema_refresh_cron.iwfm_train_refresh | list }}"

- name: setup iwfm_train schema refresh
ansible.builtin.cron:
name: "{{ item.name }}"
weekday: "{{ item.weekday }}"
minute: "{{ item.minute }}"
hour: "{{ item.hour }}"
user: root
job: "su oracle -c '/home/oracle/admin/scripts/{{ refresh_script }} -i {{ db_sid }} -d refresh_dump_dir -f {{ item.dump_file }} -t '{{ item.target_schema }}' -s {{ item.source_schema }}' 2>&1 | logger -p local3.info -t iwfm_train_refresh"
loop: "{{ training_schema_refresh_cron.train_custom_refresh | list }}"
job: "su oracle -c '/home/oracle/admin/scripts/{{ refresh_script }}' 2>&1 | logger -p local3.info -t {{ item.name }}"
loop: "{{ training_schema_refresh_cron | list }}"
Loading

0 comments on commit 7138ebc

Please sign in to comment.