Preserve linebreaks in nginx specific extra locations vars when generating the server-vars.yml for edx_ansible.
The var: "" syntax strips linebreaks out and that leaves us with invalid nginx config files in some cases. Switch to var: | to allow multi-line content to go through correctly.
As a longer term solution, we should probably just move everything from the nginx config files for custom domains that is duplicated across all of them (ie, everything that doesn't specify the hostname or the path to the SSL certs) into a single include file. Then when the cert agent runs the ansible playbook, it wouldn't have to touch that include file and there would be fewer things that could break. I'm looking into setting that up, but in the meantime, this should prevent the immediate problem from happening again.
Preserve linebreaks in nginx specific extra locations vars when generating the
server-vars.yml
for edx_ansible.The
var: ""
syntax strips linebreaks out and that leaves us with invalid nginx config files in some cases. Switch tovar: |
to allow multi-line content to go through correctly.See my discussion in Slack last friday for details on how that broke nginx for us: https://appsembler.slack.com/archives/C0DLX9U86/p1612517691118600
As a longer term solution, we should probably just move everything from the nginx config files for custom domains that is duplicated across all of them (ie, everything that doesn't specify the hostname or the path to the SSL certs) into a single include file. Then when the cert agent runs the ansible playbook, it wouldn't have to touch that include file and there would be fewer things that could break. I'm looking into setting that up, but in the meantime, this should prevent the immediate problem from happening again.