Closed talset closed 2 years ago
Recently templates/unit.j2 has been updated with if condition around container_cmd
templates/unit.j2
container_cmd
{{ container_image }} {% if container_cmd is string %}{{ container_cmd | trim }}{% else %}{{ container_cmd | join(' ') | trim }}{% endif %}
It seems jinja trim line ending by "if" condition and we end up with systems config like
ExecStart=/usr/bin/docker run \ --name vault \ --rm \ --env-file /etc/default/vault \ --volume /opt/cycloid/vault/config:/vault/config --volume /opt/cycloid/vault/file:/vault/file \ --publish 8200:8200 \ \ \ \ \ \ \ --cap-add IPC_LOCK \ vault:1.5.4 vault server -config /vault/config/local.jsonExecStop=/usr/bin/docker stop vault ExecStartPost=-/opt/cycloid/vault/unseal.sh
As you can see the newline before ExecStop is not respected. Should we force a new line before ExecStop ?
Version ansible 2.9.27 jinja2 2.10-2
Ah yeah, if I remember correctly Jinja removes some newlines around blocks under certain circumstances
Recently
templates/unit.j2
has been updated with if condition aroundcontainer_cmd
It seems jinja trim line ending by "if" condition and we end up with systems config like
As you can see the newline before ExecStop is not respected. Should we force a new line before ExecStop ?
Version ansible 2.9.27 jinja2 2.10-2