Skip to content

Commit

Permalink
fix(compose): no var interpolation + path resolution
Browse files Browse the repository at this point in the history
Due to consolidating the InfluxDBv1/v2 related env vars into
`.env` the playbook generates a Compose file with no values set
for any environment variables that need to be interpolated via
the `.env` file. In order to mitigate this, the compose validation
+ generation tasks do not interpolate the env vars and remove
path resolution too. With this fix, the files generated can then
rely on `.env` file even if the file generated after validation.

fixes #102

Signed-off-by: Shantanoo 'Shan' Desai <[email protected]>
  • Loading branch information
shantanoo-desai committed Jul 27, 2023
1 parent 6d1f4d8 commit febd34d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions generate_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
block:
- name: "(DockerCompose) Validating Docker Compose Services"
ansible.builtin.command:
cmd: docker compose {{ compose_files }} config --quiet
cmd: docker compose {{ compose_files }} config --no-interpolate --no-path-resolution --quiet
args:
chdir: "{{ komponist.deploy_dir }}"
vars:
Expand All @@ -50,7 +50,11 @@

- name: "(DockerCompose) Generating docker-compose.yml file if all services are valid"
ansible.builtin.command:
cmd: docker compose -p {{ komponist.configuration.project_name | default('komponist') }} {{ compose_files }} config -o docker-compose.yml
cmd: >
docker compose -p {{ komponist.configuration.project_name | default('komponist') }} {{ compose_files }} config
--no-interpolate
--no-path-resolution
-o docker-compose.yml
args:
chdir: "{{ komponist.deploy_dir }}"
vars:
Expand Down

0 comments on commit febd34d

Please sign in to comment.