kolla-ansible/ansible/roles/common/templates/cron.json.j2
Mark Goddard f329af7dfa Performance: use a single config file for logrotate
Currently we generate a logrotate configuration file for each enabled
service. These are then included from a logrotate.d directory. With a
large number of hosts, this can take a long time to template.

Benchmarking of templating is available at [1].

This change switches to a single logrotate configuration file for all
services, with the include done locally using jinja. This should
drastically improve the performance of this task.

[1] https://github.com/stackhpc/ansible-scaling/blob/master/doc/template.md

Partially-Implements: blueprint performance-improvements

Change-Id: I39cfa70bef6560f615cad516c43aaef6a523b964
2020-07-28 12:14:47 +01:00

13 lines
352 B
Django/Jinja

{% set cron_cmd = 'cron -f' if kolla_base_distro in ['ubuntu', 'debian'] else 'crond -s -n' %}
{
"command": "{{ cron_cmd }}",
"config_files": [
{
"source": "{{ container_config_directory }}/logrotate.conf",
"dest": "/etc/logrotate.conf",
"owner": "root",
"perm": "0600"
}
]
}