Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

Suppress blank template lines #83

Closed
wants to merge 2 commits into from
Closed

Suppress blank template lines #83

wants to merge 2 commits into from

Conversation

kousu
Copy link

@kousu kousu commented Apr 25, 2021

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.

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.
@jnv
Copy link
Owner

jnv commented Apr 28, 2021

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.

@jnv jnv marked this pull request as draft April 28, 2021 06:52
@jnv
Copy link
Owner

jnv commented May 23, 2022

I am closing this PR since this role has been deprecated. Feel free to suggest alternatives in #98.

@jnv jnv closed this May 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants