Skip to content

Commit

Permalink
Update PPA configurations and playbook
Browse files Browse the repository at this point in the history
- enable crontab
- configure cron job to reindex gale pages every first Saturday
- revise gale local ocr path
- remove unneeded transitional extra dependency
  • Loading branch information
rlskoeser committed Nov 4, 2024
1 parent f5b9514 commit b05be36
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 9 deletions.
11 changes: 7 additions & 4 deletions inventory/group_vars/prosody/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ marc_data_path: "{{ data_path }}/marc/"
# path to EEBO TCP data
eebo_data_path: "{{ data_path }}/eebo_tcp/"
# path to Gale OCR data on tigerdata
gale_ocr_data_path: "{{ tigerdata_mount_dir }}/prosody/ppa-ocr/Gale"
gale_ocr_data_path: "{{ tigerdata_mount_dir }}/prosody/ppa-ocr/Gale-by-vol"

technical_contact: [email protected]
# flag that csp is enabled
Expand Down Expand Up @@ -80,8 +80,11 @@ tigerdata_enabled: true
# media nfs path
media_root: /mnt/nfs/cdh/prosody/media/

# app-specific system dependencies
app_dependencies:
- libmysqlclient-dev # for mysql installation during the migration
# app-specific system dependencies - no longer needed
#app_dependencies:
# common datadog configuration set in all vars
datadog_app_name: cdh_prosody

# configure scripts to run as cron jobs
crontab: []
# currently production only
15 changes: 15 additions & 0 deletions inventory/group_vars/prosody_production/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,18 @@ deploy_contexts:
- 'javascript unit tests'
- 'Python unit tests'
# - 'codecov/project'

# run cron jobs on the first vm
cronjob_host: "cdh-prosody1.princeton.edu"

# configure scripts to run as cron jobs
crontab:
# schedule monthly reindex of Gale pages to update encrypted image urls
- name: "{{ django_app }} reindex Gale pages"
# run at 2am on the first Saturday of every month
minute: 0
hour: 2
weekday: "SAT"
day: "1-7"
job: "bin/cron-wrapper {{ deploy }}/env/bin/python {{ deploy }}/manage.py index_pages -p 4 --gale --no-progress >> {{ logging_dir }}/cron_reindex_gale_pages.log 2>&1"
state: present
3 changes: 3 additions & 0 deletions inventory/group_vars/prosody_staging/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ zk_host: "lib-zk-staging4:2181,lib-zk-staging5:2181,lib-zk-staging6:2181/solr9"
solr_url: "http://lib-solr9-staging.princeton.edu:8983/solr/"
solr_server: "{{ groups['solr9_staging'][0] }}"
solr_version: 9

# run cron jobs on the first vm
cronjob_host: "cdh-test-prosody1.princeton.edu"
13 changes: 8 additions & 5 deletions playbooks/prosody.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@
- solr_collection
- prosody_setup
- finalize_deploy
- configure_crontab # used in production but not always in staging
- close_deployment
tasks:
- ansible.builtin.include_role: # datadog for logging
name: pulibrary.princeton_ansible.datadog
when: runtime_env | default('staging') == "production"
tags:
- datadog
- ansible.builtin.include_role: # timezone needed for cron jobs
name: pulibrary.princeton_ansible.timezone
- ansible.builtin.include_role: # datadog for logging
name: pulibrary.princeton_ansible.datadog
when: runtime_env | default('staging') == "production"
tags:
- datadog
2 changes: 2 additions & 0 deletions roles/configure_crontab/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
- name: Configure cron jobs
when: inventory_hostname == cronjob_host
tags:
- crontab
block:
- name: "Configure crontab — special times"
cron:
Expand Down

0 comments on commit b05be36

Please sign in to comment.