Eduardo Gonzalez 3bd180f857 Only enabled services log files
Only enabled services logs should be added to cron container
and be inclued in cron.json.
This PS adds logic to only copy enabled services cron files.

Change-Id: Id6303a4c77a0230599e11be165489ba46dba65e0
Closes-bug: #1623712
2016-09-18 13:21:58 +02:00

45 lines
1.4 KiB
Django/Jinja

{% set cron_cmd = 'cron -f' if kolla_base_distro in ['ubuntu', 'debian'] else 'crond -s -n' %}
{% set services = [
( 'ansible', 'yes' ),
( 'aodh', enable_aodh ),
( 'barbican', enable_barbican ),
( 'cinder', enable_cinder ),
( 'cloudkitty', enable_cloudkitty ),
( 'glance', enable_glance ),
( 'gnocchi', enable_gnocchi ),
( 'haproxy', enable_haproxy ),
( 'heat', enable_heat ),
( 'keepalived', enable_haproxy ),
( 'keystone', enable_keystone ),
( 'magnum', enable_magnum ),
( 'manila', enable_manila ),
( 'mariadb', enable_mariadb ),
( 'mistral', enable_mistral ),
( 'murano', enable_murano ),
( 'neutron', enable_neutron ),
( 'nova', enable_nova ),
( 'rabbitmq', enable_rabbitmq ),
( 'senlin', enable_senlin ),
( 'swift', enable_swift )
] %}
{
"command": "{{ cron_cmd }}",
"config_files": [
{
"source": "{{ container_config_directory }}/logrotate/global.conf",
"dest": "/etc/logrotate.conf",
"owner": "root",
"perm": "0644"
},
{% for service, enabled in services if enabled | bool %}
{
"source": "{{ container_config_directory }}/logrotate/{{ service }}.conf",
"dest": "/etc/logrotate.d/{{ service }}.conf",
"owner": "root",
"perm": "0644"
}{{ ',' if not loop.last else '' }}
{% endfor %}
]
}