In defaults/main.yml variable promtail_config_expand_env have a string type. And condition in templates/service.j2 have no bool filter. As result with the default vars option -config.expand-env will be true. When promtail_config_expand_env is false without quotes, option -config.expand-env will be false.
Also templating -config.expand-env={{ "true" if promtail_config_expand_env else "false" }} can be simplified to -config.expand-env={{ promtail_config_expand_env | string }}
In
defaults/main.yml
variablepromtail_config_expand_env
have a string type. And condition intemplates/service.j2
have nobool
filter. As result with the default vars option-config.expand-env
will betrue
. Whenpromtail_config_expand_env
isfalse
without quotes, option-config.expand-env
will befalse
.Also templating
-config.expand-env={{ "true" if promtail_config_expand_env else "false" }}
can be simplified to-config.expand-env={{ promtail_config_expand_env | string }}