ansible-logrotate-plusplus/templates/etc/logrotate.d/application.j2
Serge van Ginderachter 82d5bd7d16
Add check to deploy config if log exists
Role will now test if a log exist (and hence the application exists
    on the host before writing a logrotate config to the server.
2020-09-17 22:23:16 +02:00

36 lines
704 B
Django/Jinja

{{ ansible_managed | comment }}
{{ item.logs | join(" ") }} {
{% for option in item.options %}
{{ option }}
{% endfor %}
{% if item.postrotate|default([]) %}
postrotate
{% for line in item.postrotate %}
{{ line }}
{% endfor %}
endscript
{% endif %}
{% if item.preremove|default([]) %}
preremove
{% for line in item.preremove %}
{{ line }}
{% endfor %}
endscript
{% endif %}
{% if item.lastaction|default([]) %}
lastaction
{% for line in item.lastaction %}
{{ line }}
{% endfor %}
endscript
{% endif %}
{% if item.firstaction|default([]) %}
firstaction
{% for line in item.firstaction %}
{{ line }}
{% endfor %}
endscript
{% endif %}
}