Merge "Only enabled services log files"

This commit is contained in:
Jenkins 2016-09-22 08:16:24 +00:00 committed by Gerrit Code Review
commit f0d8b12930
2 changed files with 49 additions and 48 deletions

View File

@ -65,29 +65,30 @@
- name: Copying over cron logrotate config files - name: Copying over cron logrotate config files
template: template:
src: "cron-logrotate-{{ item }}.conf.j2" src: "cron-logrotate-{{ item.name }}.conf.j2"
dest: "{{ node_config_directory }}/cron/logrotate/{{ item }}.conf" dest: "{{ node_config_directory }}/cron/logrotate/{{ item.name }}.conf"
when: item.enabled | bool
with_items: with_items:
- "ansible" - { name: "ansible", enabled: "yes" }
- "aodh" - { name: "aodh", enabled: "{{ enable_aodh }}" }
- "barbican" - { name: "barbican", enabled: "{{ enable_barbican }}" }
- "cinder" - { name: "cinder", enabled: "{{ enable_cinder }}" }
- "cloudkitty" - { name: "cloudkitty", enabled: "{{ enable_cloudkitty }}" }
- "glance" - { name: "glance", enabled: "{{ enable_glance }}" }
- "global" - { name: "global", enabled: "yes" }
- "gnocchi" - { name: "gnocchi", enabled: "{{ enable_gnocchi }}" }
- "haproxy" - { name: "haproxy", enabled: "{{ enable_haproxy }}" }
- "heat" - { name: "heat", enabled: "{{ enable_heat }}" }
- "keepalived" - { name: "keepalived", enabled: "{{ enable_haproxy }}" }
- "keystone" - { name: "keystone", enabled: "{{ enable_keystone }}" }
- "magnum" - { name: "magnum", enabled: "{{ enable_magnum }}" }
- "manila" - { name: "manila", enabled: "{{ enable_manila }}" }
- "mariadb" - { name: "mariadb", enabled: "{{ enable_mariadb }}" }
- "mistral" - { name: "mistral", enabled: "{{ enable_mistral }}" }
- "murano" - { name: "murano", enabled: "{{ enable_murano }}" }
- "neutron" - { name: "neutron", enabled: "{{ enable_neutron }}" }
- "nova" - { name: "nova", enabled: "{{ enable_nova }}" }
- "rabbitmq" - { name: "rabbitmq", enabled: "{{ enable_rabbitmq }}" }
- "senlin" - { name: "senlin", enabled: "{{ enable_senlin }}" }
- "swift" - { name: "swift", enabled: "{{ enable_swift }}" }
- "watcher" - { name: "watcher", enabled: "{{ enable_watcher }}" }

View File

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