Move the harvesters cron job.

This commit is contained in:
Andrea Dell'Amico 2021-12-15 16:46:20 +01:00
parent 724c7a3aeb
commit 32008a64f3
Signed by untrusted user: adellam
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 21 additions and 1 deletions

View File

@ -33,6 +33,8 @@ ckan_dcat_name: 'dcat dcat_json_interface'
# Set this to true to install a cron job that regularly runs the harvesters
ckan_harvester_run: False
ckan_harvester_cron_min: 0
ckan_harvester_cron_hour: '*'
ckan_pdfview: False
ckan_ckanext_pdfview_url: ckanext-pdfview
ckan_privatedatasets: False

View File

@ -8,8 +8,26 @@
notify: Reconfigure the supervisor daemon
tags: [ 'ckan', 'ckan_harvest' ]
- name: Remove the old harvester cron job
ansible.builtin.cron:
name: "CKAN harvester"
minute: "{{ ckan_harvester_cron_min }}"
job: "{{ ckan_virtenv }}/bin/paster --plugin=ckanext-harvest harvester run --config={{ ckan_config_file }} > {{ ckan_logdir }}/harvester_run.log 2>&1"
user: {{ ckan_shell_user }}
state: absent
when: ckan_harvester_run
tags: [ 'ckan', 'ckan_harvest', 'ckan_harvest_cron' ]
- name: Install a cron job that run the harvesters
cron: name="CKAN harvester" minute="0" job="{{ ckan_virtenv }}/bin/paster --plugin=ckanext-harvest harvester run --config={{ ckan_config_file }} > {{ ckan_logdir }}/harvester_run.log 2>&1" user={{ ckan_shell_user }}
ansible.builtin.cron:
name: "CKAN harvester"
minute: "{{ ckan_harvester_cron_min }}"
hour: "{{ ckan_harvester_cron_hour }}"
job: "{{ ckan_virtenv }}/bin/paster --plugin=ckanext-harvest harvester run --config={{ ckan_config_file }} > {{ ckan_logdir }}/harvester_run.log 2>&1"
user: {{ ckan_shell_user }}
state: present
disabled: no
cron_file: ckan_harvesters
when: ckan_harvester_run
tags: [ 'ckan', 'ckan_harvest', 'ckan_harvest_cron' ]