autoreg cronjob fails because can't found controllers.yaml in root dir
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charm-autoreg |
Invalid
|
Undecided
|
Unassigned |
Bug Description
This is happening both in bionic and xenial.
When I run the cronjob generated like this:
19,49 * * * * root autoreg.
the autoreg.
my controllers.yaml is in /home/ubuntu/
and
$ juju config autoreg-xenial bootstrap-user
ubuntu
If I am not missing something, I expect the charm should look for controllers.yaml under the ubuntu home directory.
To workaround this I copied /home/ubuntu/
To make that work by hand, you need to export the two environment variables directly above the command line in the cron job. Specifically, this is what you would run as root:
export JUJU_DATA= /home/ubuntu/ .local/ share/juju local/bin: /bin:/usr/ bin:/snap/ bin:/sbin: /usr/sbin: /usr/local/ sbin sync-juju- users --model-access admin --controller-access superuser --groups warthogs; autoreg. collect- user-keys --groups warthogs --targetdir /var/lib/ charm-autoreg/ sshkeys
export PATH=/usr/
autoreg.
I've tested the above and it does work. Thus, I think this bug is invalid.