kolla-ansible/ansible/roles/keystone/templates/crontab.j2
Mark Goddard d09ee49afc Fix keystone fernet rotation for source images
In source images, keystone-manage is installed to a virtualenv in
/var/lib/kolla/venv. This is not in the PATH for cron jobs, which always
use PATH=/usr/bin:/bin. This results in the following error:

/usr/bin/fernet-rotate.sh: line 3: keystone-manage: command not found

However this error is not typically visible, since cron logs to syslog
and we do not configure fluentd to collect these logs.

This change configures the PATH in the fernet-rotate.sh script for
source images.

Change-Id: Ib49ea586d36ae32d01b9610a48b13798db4a4cd5
Closes-Bug: #1850711
2019-11-05 12:06:26 +00:00

10 lines
355 B
Django/Jinja

{# Cron uses a PATH of /usr/bin:/bin by default, which does not include the #}
{# virtualenv in source images. #}
{% if keystone_install_type == 'source' %}
PATH=/var/lib/kolla/venv/bin:/usr/bin:/bin
{% endif %}
{% for cron_job in cron_jobs %}
{{ cron_job['min'] }} {{ cron_job['hour'] }} * * {{ cron_job['day'] }} /usr/bin/fernet-rotate.sh
{% endfor %}