Skip to content

Commit

Permalink
🐛(playbook) fix JSON config file generation from jinja2 template
Browse files Browse the repository at this point in the history
The deploy playbook fails to generate a ConfigMap if it contains a
JSON file generated from a Jinja2 template.

Fixes #450
  • Loading branch information
madmatah authored and jmaupetit committed Jan 29, 2020
1 parent 6e45ccb commit ff01ee7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Versioning](http://semver.org/spec/v2.0.0.html).

- `edxapp`'s `nginx` service now uses a docker image with bundled CMS & LMS static files

### Fixed

- Error while generating JSON config file from jinja2 template

### Removed

- `edxapp`'s static files collection jobs are no longer required
Expand Down
5 changes: 5 additions & 0 deletions apps/hello/templates/services/app/configs/test.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"stamp": "{{ deployment_stamp }}",
"project": "{{ project_name }}",
"key": "valu€"
}
2 changes: 1 addition & 1 deletion tasks/create_app_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{%- for service in app_configmaps -%}
{%- set _ = configmaps.update({ service.name: {} }) -%}
{%- for cm_path in service.configs -%}
{%- set content = lookup('template', cm_path) -%}
{%- set content = lookup('template', cm_path, convert_data = False) -%}
{%- set filename = cm_path | basename | regex_replace('.j2') -%}
{%- set _ = configmaps.get(service.name).update({filename: content}) -%}
{%- endfor -%}
Expand Down

0 comments on commit ff01ee7

Please sign in to comment.