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.
This commit is contained in:
parent
b0e5245e4e
commit
82d5bd7d16
5 changed files with 90 additions and 32 deletions
|
@ -1,37 +1,35 @@
|
|||
{{ ansible_managed | comment }}
|
||||
|
||||
{% for definition in item.definitions %}
|
||||
{{ definition.logs | join(" ") }} {
|
||||
{% for option in definition.options %}
|
||||
{{ item.logs | join(" ") }} {
|
||||
{% for option in item.options %}
|
||||
{{ option }}
|
||||
{% endfor %}
|
||||
{% if definition.postrotate|default([]) %}
|
||||
{% if item.postrotate|default([]) %}
|
||||
postrotate
|
||||
{% for line in definition.postrotate %}
|
||||
{% for line in item.postrotate %}
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
endscript
|
||||
{% endif %}
|
||||
{% if definition.preremove|default([]) %}
|
||||
{% if item.preremove|default([]) %}
|
||||
preremove
|
||||
{% for line in definition.preremove %}
|
||||
{% for line in item.preremove %}
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
endscript
|
||||
{% endif %}
|
||||
{% if definition.lastaction|default([]) %}
|
||||
{% if item.lastaction|default([]) %}
|
||||
lastaction
|
||||
{% for line in definition.lastaction %}
|
||||
{% for line in item.lastaction %}
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
endscript
|
||||
{% endif %}
|
||||
{% if definition.firstaction|default([]) %}
|
||||
{% if item.firstaction|default([]) %}
|
||||
firstaction
|
||||
{% for line in definition.firstaction %}
|
||||
{% for line in item.firstaction %}
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
endscript
|
||||
{% endif %}
|
||||
}
|
||||
{% endfor %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue