Skip to content

Commit 5564878

Browse files
authored
Update alloy.j2 to correctly embed env file variable options
Env file variable options such as `--stability.level public-preview` in your Ansible configuration cause them to be embedded without being escaped in double quotes in the env file. This causes upgrade failures whereby the `prerm` script for the alloy package attempts executing the unescaped half, causing dpkg to spit out the error `/var/lib/dpkg/info/alloy.prerm: 6: /etc/default/alloy: public-preview: not found` for a configuration like so ``` # Ansible Managed CONFIG_FILE="/etc/alloy/config.alloy" RESTART_ON_UPGRADE=true CUSTOM_ARGS=--stability.level public-preview ```
1 parent 21bb89c commit 5564878

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

roles/alloy/templates/alloy.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ CONFIG_FILE="/etc/alloy/config.alloy"
66
RESTART_ON_UPGRADE=true
77

88
{% for key, value in alloy_env_file_vars.items() %}
9-
{{ key}}={{value}}
9+
{{ key}}="{{value}}"
1010
{% endfor %}

0 commit comments

Comments
 (0)