appsembler / configuration

a simple, but flexible, way for anyone to stand up an instance of the edX platform that is fully configured and ready-to-go
GNU Affero General Public License v3.0
14 stars 13 forks source link

ensure config directory exists before copying files to it #285

Closed thraxil closed 4 years ago

thraxil commented 4 years ago

I keep seeing deployments fail on the first time with this error:

TASK [edxapp : copy Mongo CA certificate] **************************************
fatal: [...]: FAILED! => {"changed": false, "checksum": "...", "failed": true, "msg":
"Destination directory /edx/etc/edxapp does not exist"}

The copy Mongo CA certificates step wants to copy files to /edx/etc/edxapp/, but on the first deploy, only /edx/etc/ already exists. EDXAPP_CFG_DIR seems to be the variable that it uses to construct the certificate file path, so this makes that directory if it doesn't already exist (I can't find anywhere in the playbooks that would create it otherwise, so I'm not sure how this was ever supposed to work).

root/root ownership is from looking at that directory on existing servers.

There might be a better place to put this, but we at least know that it needs to come before the copy Mongo CA certificate task.