Import github.com/arillso/ansible.logrotate
at version 1.5.2 (commit 038649f
This commit is contained in:
parent
008fdbaa1f
commit
b0e5245e4e
9 changed files with 248 additions and 0 deletions
30
templates/etc/logrotate.conf.j2
Normal file
30
templates/etc/logrotate.conf.j2
Normal file
|
@ -0,0 +1,30 @@
|
|||
{{ ansible_managed | comment }}
|
||||
|
||||
# see "man logrotate" for details
|
||||
{% if logrotate_options | length > 0 %}
|
||||
{% for option in logrotate_options %}
|
||||
{{ option }}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for option in logrotate_distribution_options | default([]) %}
|
||||
{{ option }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
# packages drop log rotation information into this directory
|
||||
include {{ logrotate_include_dir }}
|
||||
|
||||
# no packages own wtmp, or btmp -- we'll rotate them here
|
||||
{{ logrotate_wtmp.logs | join(" ") }} {
|
||||
{% for option in logrotate_wtmp.options %}
|
||||
{{ option }}
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
{{ logrotate_btmp.logs | join(" ") }} {
|
||||
{% for option in logrotate_btmp.options %}
|
||||
{{ option }}
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
# system-specific logs may be configured here
|
37
templates/etc/logrotate.d/application.j2
Normal file
37
templates/etc/logrotate.d/application.j2
Normal file
|
@ -0,0 +1,37 @@
|
|||
{{ ansible_managed | comment }}
|
||||
|
||||
{% for definition in item.definitions %}
|
||||
{{ definition.logs | join(" ") }} {
|
||||
{% for option in definition.options %}
|
||||
{{ option }}
|
||||
{% endfor %}
|
||||
{% if definition.postrotate|default([]) %}
|
||||
postrotate
|
||||
{% for line in definition.postrotate %}
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
endscript
|
||||
{% endif %}
|
||||
{% if definition.preremove|default([]) %}
|
||||
preremove
|
||||
{% for line in definition.preremove %}
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
endscript
|
||||
{% endif %}
|
||||
{% if definition.lastaction|default([]) %}
|
||||
lastaction
|
||||
{% for line in definition.lastaction %}
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
endscript
|
||||
{% endif %}
|
||||
{% if definition.firstaction|default([]) %}
|
||||
firstaction
|
||||
{% for line in definition.firstaction %}
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
endscript
|
||||
{% endif %}
|
||||
}
|
||||
{% endfor %}
|
Loading…
Add table
Add a link
Reference in a new issue