Skip to content
Snippets Groups Projects
Commit 3bd180f8 authored by Eduardo Gonzalez's avatar Eduardo Gonzalez
Browse files

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
parent 82c1a3d6
No related branches found
No related tags found
No related merge requests found
......@@ -65,29 +65,30 @@
- name: Copying over cron logrotate config files
template:
src: "cron-logrotate-{{ item }}.conf.j2"
dest: "{{ node_config_directory }}/cron/logrotate/{{ item }}.conf"
src: "cron-logrotate-{{ item.name }}.conf.j2"
dest: "{{ node_config_directory }}/cron/logrotate/{{ item.name }}.conf"
when: item.enabled | bool
with_items:
- "ansible"
- "aodh"
- "barbican"
- "cinder"
- "cloudkitty"
- "glance"
- "global"
- "gnocchi"
- "haproxy"
- "heat"
- "keepalived"
- "keystone"
- "magnum"
- "manila"
- "mariadb"
- "mistral"
- "murano"
- "neutron"
- "nova"
- "rabbitmq"
- "senlin"
- "swift"
- "watcher"
- { name: "ansible", enabled: "yes" }
- { name: "aodh", enabled: "{{ enable_aodh }}" }
- { name: "barbican", enabled: "{{ enable_barbican }}" }
- { name: "cinder", enabled: "{{ enable_cinder }}" }
- { name: "cloudkitty", enabled: "{{ enable_cloudkitty }}" }
- { name: "glance", enabled: "{{ enable_glance }}" }
- { name: "global", enabled: "yes" }
- { name: "gnocchi", enabled: "{{ enable_gnocchi }}" }
- { name: "haproxy", enabled: "{{ enable_haproxy }}" }
- { name: "heat", enabled: "{{ enable_heat }}" }
- { name: "keepalived", enabled: "{{ enable_haproxy }}" }
- { name: "keystone", enabled: "{{ enable_keystone }}" }
- { name: "magnum", enabled: "{{ enable_magnum }}" }
- { name: "manila", enabled: "{{ enable_manila }}" }
- { name: "mariadb", enabled: "{{ enable_mariadb }}" }
- { name: "mistral", enabled: "{{ enable_mistral }}" }
- { name: "murano", enabled: "{{ enable_murano }}" }
- { name: "neutron", enabled: "{{ enable_neutron }}" }
- { name: "nova", enabled: "{{ enable_nova }}" }
- { name: "rabbitmq", enabled: "{{ enable_rabbitmq }}" }
- { name: "senlin", enabled: "{{ enable_senlin }}" }
- { name: "swift", enabled: "{{ enable_swift }}" }
- { name: "watcher", enabled: "{{ enable_watcher }}" }
{% set cron_cmd = 'cron -f' if kolla_base_distro in ['ubuntu', 'debian'] else 'crond -s -n' %}
{% set services = [
"ansible",
"aodh",
"barbican",
"cinder",
"cloudkitty",
"glance",
"gnocchi",
"haproxy",
"heat",
"keepalived",
"keystone",
"magnum",
"manila",
"mariadb",
"mistral",
"murano",
"neutron",
"nova",
"rabbitmq",
"senlin",
"swift"
( '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 }}",
......@@ -31,13 +31,13 @@
"owner": "root",
"perm": "0644"
},
{% for service in services %}
{% 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 %},{% endif %}
}{{ ',' if not loop.last else '' }}
{% endfor %}
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment