Commit c64b281e authored by Maciej Delmanowski's avatar Maciej Delmanowski

Merge branch 'fix-logrotate-newlines' of https://github.com/ciphermail/debops into test-logrotate

parents 0c614691 57322a83
# {{ ansible_managed }}
{% if logrotate__options %}
{{ logrotate__options -}}
{{ logrotate__options }}
{% endif %}
{% if logrotate__group_options %}
{{ logrotate__group_options -}}
{{ logrotate__group_options }}
{% endif %}
{% if logrotate__host_options %}
{{ logrotate__host_options -}}
{{ logrotate__host_options }}
{% endif %}
{% if logrotate__default_options %}
{{ logrotate__default_options -}}
{{ logrotate__default_options }}
{% endif %}
{% macro print_config(section) %}
{% if section.state is undefined or section.state != 'absent' %}
......@@ -46,31 +46,31 @@
{% endif %}
{% endif %}
{% if section.options|d() %}
{{ section.options | indent(4, true) -}}
{{ section.options | indent(4, true) }}
{% endif %}
{% if section.firstaction|d() %}
firstaction
{{ section.firstaction | indent(8, true) -}}
{{ section.firstaction | indent(8, true) }}
{{ ' endscript' }}
{% endif %}
{% if section.prerotate|d() %}
prerotate
{{ section.prerotate | indent(8, true) -}}
{{ section.prerotate | indent(8, true) }}
{{ ' endscript' }}
{% endif %}
{% if section.postrotate|d() %}
postrotate
{{ section.postrotate | indent(8, true) -}}
{{ section.postrotate | indent(8, true) }}
{{ ' endscript' }}
{% endif %}
{% if section.preremove|d() %}
preremove
{{ section.preremove | indent(8, true) -}}
{{ section.preremove | indent(8, true) }}
{{ ' endscript' }}
{% endif %}
{% if section.lastaction|d() %}
lastaction
{{ section.lastaction | indent(8, true) -}}
{{ section.lastaction | indent(8, true) }}
{{ ' endscript' }}
{% endif %}
}
......@@ -80,7 +80,7 @@
{% if item.sections|d() %}
{% for section in item.sections %}
{% if (section.log|d() or section.logs|d() or section.filename|d()) and section.state|d('present') != 'absent' %}
{{ print_config(section) -}}
{{ print_config(section) }}
{% if not loop.last %}
{% endif %}
......@@ -88,7 +88,7 @@
{% endfor %}
{% else %}
{% if (item.log|d() or item.logs|d() or item.filename|d()) and item.state|d('present') != 'absent' %}
{{ print_config(item) -}}
{{ print_config(item) }}
{% if not loop.last %}
{% endif %}
......
......@@ -4,7 +4,7 @@
{% if section.state is undefined or section.state != 'absent' %}
{% if section.comment|d() %}
{{ section.comment | regex_replace('\n$','') | comment(prefix='', postfix='') -}}
{{ section.comment | regex_replace('\n$','') | comment(prefix='', postfix='') }}
{% endif %}
{% if section.log|d() %}
{% if section.log is string %}
......@@ -35,9 +35,9 @@
{% endif %}
{% if section.options|d() %}
{% if section.log|d() or section.logs|d() %}
{{ section.options | indent(4, true) -}}
{{ section.options | indent(4, true) }}
{% else %}
{{ section.options -}}
{{ section.options }}
{% endif %}
{% endif %}
{% if section.log|d() or section.logs|d() %}
......@@ -48,23 +48,23 @@
{% endif %}
{% if section.prerotate|d() %}
prerotate
{{ section.prerotate | indent(8, true) -}}
{{ section.prerotate | indent(8, true) }}
{{ ' endscript' }}
{% endif %}
{% if section.postrotate|d() %}
postrotate
{{ section.postrotate | indent(8, true) -}}
{{ section.postrotate | indent(8, true) }}
{{ ' endscript' }}
{% endif %}
{% if section.preremove|d() %}
preremove
{{ section.preremove | indent(8, true) -}}
{{ section.preremove | indent(8, true) }}
{{ ' endscript' }}
{% endif %}
{% if section.lastaction|d() %}
lastaction
{{ section.lastaction | indent(8, true) -}}
{{ section.lastaction | indent(8, true) }}
{{ ' endscript' }}
{% endif %}
}
......@@ -74,7 +74,7 @@
{% if item.sections|d() %}
{% for section in item.sections %}
{% if (section.log|d() or section.logs|d() or section.filename|d()) and section.state|d('present') != 'absent' %}
{{ print_config(section) -}}
{{ print_config(section) }}
{% if not loop.last %}
{% endif %}
......@@ -82,6 +82,6 @@
{% endfor %}
{% else %}
{% if (item.log|d() or item.logs|d() or item.filename|d()) and item.state|d('present') != 'absent' %}
{{ print_config(item) -}}
{{ print_config(item) }}
{% endif %}
{% endif %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment