ara_api: Add conjobs
Create cron tasks to clean up old stuff from ARA, disabled by default but can be enabled if desired Change-Id: I8d54a2649bb7b82298d73b5d9b89a857807f6d1e
This commit is contained in:
parent
6036126977
commit
17d360c30e
@ -204,3 +204,16 @@ ara_api_database_conn_max_age: 0
|
|||||||
# timezone but Ansible doesn't provide, for example, an ansible_timezone fact
|
# timezone but Ansible doesn't provide, for example, an ansible_timezone fact
|
||||||
# that we could use here. With that in mind, UTC is the best default for now.
|
# that we could use here. With that in mind, UTC is the best default for now.
|
||||||
ara_api_time_zone: UTC
|
ara_api_time_zone: UTC
|
||||||
|
|
||||||
|
# ARA cleanup settings
|
||||||
|
# The following settings configure daily maintenance cronjobs
|
||||||
|
ara_api_configure_cron: false
|
||||||
|
|
||||||
|
# When configuring cronjobs, only provide the arguments for the ara CLI utility
|
||||||
|
ara_api_cleanup_crons:
|
||||||
|
- name: ara_api expire running playbooks
|
||||||
|
arguments: 'expire --server http://localhost:8000 --client http --confirm --hours 24'
|
||||||
|
special_time: 'daily' # you can also use other time arguments from the cron module
|
||||||
|
- name: ara_api prune old reports
|
||||||
|
arguments: 'playbook prune --server http://localhost:8000 --client http --confirm --days 30'
|
||||||
|
special_time: 'daily'
|
||||||
|
@ -110,3 +110,18 @@
|
|||||||
notify:
|
notify:
|
||||||
- restart ara-api
|
- restart ara-api
|
||||||
no_log: "{{ ara_api_secure_logging }}"
|
no_log: "{{ ara_api_secure_logging }}"
|
||||||
|
|
||||||
|
- name: Set up ARA API cronjobs
|
||||||
|
cron:
|
||||||
|
name: "{{ job['name'] }}"
|
||||||
|
special_time: "{{ job['special_time'] | default(omit) }}"
|
||||||
|
minute: "{{ job['minute'] | default(omit) }}"
|
||||||
|
hour: "{{ job['hour'] | default(omit) }}"
|
||||||
|
day: "{{ job['day'] | default(omit) }}"
|
||||||
|
weekday: "{{ job['weekday'] | default(omit) }}"
|
||||||
|
month: "{{ job['month'] | default(omit) }}"
|
||||||
|
job: "{{ ara_api_venv_path }}/bin/ara {{ job['arguments'] }} >/dev/null 2>&1"
|
||||||
|
loop: "{{ ara_api_cleanup_crons }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: 'job'
|
||||||
|
when: ara_api_configure_cron
|
||||||
|
Loading…
x
Reference in New Issue
Block a user