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
This commit is contained in:
Mark Goddard 2019-11-05 12:06:26 +00:00
parent 6160cdc576
commit d09ee49afc
1 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,9 @@
{# 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 %}