ara-collection
ara-collection copied to clipboard
Clean up crons probably don't work without a virtualenv
I haven't tested it yet but came across this when looking at something else.
Because of the way it is written, it would probably not work if the installation is not done with a virtualenv: https://github.com/ansible-community/ara-collection/blob/dd253c0a239927dfe6dbcf4855b6a1f8c81d936b/roles/ara_api/tasks/config.yaml#L116-L129
Throughout the role we avoid needing to specify a hardcoded path because we prepend the virtualenv bin (if there is one) to the PATH: https://github.com/ansible-community/ara-collection/blob/dd253c0a239927dfe6dbcf4855b6a1f8c81d936b/roles/ara_api/tasks/install/pypi.yaml#L11-L14
We would probably need to do something similar here.
A drive-by thing that I noticed: cronie isn't installed by default in some distros now so we added it as a dependency but we have nothing that ensures that the crond service is started -- which it isn't if we just installed the package.
Installing cronie provides crontab which allows us to set up the cron but it will never work if crond is not enabled and started.