Closed kousu closed 2 years ago
Hi @kousu, thanks for the suggestion but I wouldn't like to sacrifice readability for such (in my opinion) minor aesthetic issue. However, I think using an explicit whitespace control you mentioned could be a good way to approach it. Perhaps something like that:
{%- if unattended_download_upgradeable is defined -%}
APT::Periodic::Download-Upgradeable-Packages "{{unattended_download_upgradeable}}";
{%- endif %}
According to this answer templates also accept special control statements like: #jinja2: lstrip_blocks: True
, so try if that works for you.
I will turn this PR into a draft, feel free to republish it once you make adjustments.
I am closing this PR since this role has been deprecated. Feel free to suggest alternatives in #98.
My /etc/apt/apt.conf.d/50unattended-upgrades are coming out with an extra 5 trailing lines that are distracting.
Maybe this is better handled with https://jinja.palletsprojects.com/en/master/templates/#whitespace-control but I don't understand how to use that.