Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixity: Add cron variables #409

Open
wants to merge 1 commit into
base: qa/1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tasks/fixity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@
cron:
name: "Run fixity"
job: "/usr/local/bin/fixity-cron"
minute: "0"
hour: "3"
day: "1"
month: "*/3"
minute: "{{ archivematica_fixity_cron_minute }}"
hour: "{{ archivematica_fixity_cron_hour }}"
day: "{{ archivematica_fixity_cron_day }}"
month: "{{ archivematica_fixity_cron_month }}"
weekday: "{{ archivematica_fixity_cron_weekday }}"
user: "archivematica"
cron_file: "fixity"
state: "present"
Expand Down
6 changes: 6 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ archivematica_src_ss_gunicorn_config: "/etc/archivematica/storage-service.gunico
archivematica_src_am_amauat_deps: []
archivematica_src_am_fixity_deps: []

archivematica_fixity_cron_minute: "0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vars/main.yml is not the best place to put the variables when you want to allow the change when settings in host_vars or group_vars.

See: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#understanding-variable-precedence

I'd use defaults/main.yml instead to set the default values.

archivematica_fixity_cron_hour: "0"
archivematica_fixity_cron_day: "*"
archivematica_fixity_cron_month: "*/6"
archivematica_fixity_cron_weekday: "*"

archivematica_src_virtualenv: "/var/lib/archivematica/.local/bin/virtualenv"
archivematica_src_pip: "/var/lib/archivematica/.local/bin/pip"
# Ubuntu 18 and CentOS/RHEL 7 only have python3.8
Expand Down