Michal Nasiadka 4180bee020 Use fluentd image labels
In order to orchestrate smooth transition to fluentd 0.14.x
aka 1.0 stable branch aka td-agent 3
from td-agent repository - use image labels (fluentd_version
and fluentd_binary).

Depends-On: https://review.opendev.org/676411
Change-Id: Iab8518c34ef876056c6abcdb5f2e9fc9f1f7dbdd
2019-08-22 12:36:51 +00:00

72 lines
2.5 KiB
Django/Jinja

{% set fluentd_user = fluentd_binary %}
{% set fluentd_dir = '/etc/' ~ fluentd_binary %}
{% if fluentd_binary == 'fluentd' %}
{% set fluentd_conf = 'fluent.conf' %}
{% if kolla_base_distro in ['ubuntu', 'debian'] %}
{% set fluentd_cmd = '/usr/local/bin/fluentd -c ' ~ fluentd_dir ~ '/' ~ fluentd_conf %}
{% else %}
{% set fluentd_cmd = '/usr/bin/fluentd -c ' ~ fluentd_dir ~ '/' ~ fluentd_conf %}
{% endif %}
{% elif fluentd_binary == 'td-agent' %}
{% set fluentd_conf = fluentd_binary ~ '.conf' %}
{% set fluentd_cmd = '/usr/sbin/td-agent' %}
{% endif %}
{
"command": "{{ fluentd_cmd }}",
"config_files": [
{
"source": "{{ container_config_directory }}/td-agent.conf",
"dest": "{{ fluentd_dir }}/{{ fluentd_conf }}",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in input/ directory to include #}
{# custom input configs. #}
{
"source": "{{ container_config_directory }}/input/*.conf",
"dest": "{{ fluentd_dir }}/input/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in filter/ directory to include #}
{# custom filter configs. #}
{
"source": "{{ container_config_directory }}/filter/*.conf",
"dest": "{{ fluentd_dir }}/filter/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in format/ directory to include #}
{# custom format configs. #}
{
"source": "{{ container_config_directory }}/format/*.conf",
"dest": "{{ fluentd_dir }}/format/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
},
{# Copy all configuration files in output/ directory to include #}
{# custom output configs. #}
{
"source": "{{ container_config_directory }}/output/*.conf",
"dest": "{{ fluentd_dir }}/output/",
"owner": "{{ fluentd_user }}",
"perm": "0600"
}
],
"permissions": [
{
"path": "/var/log/kolla/haproxy",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",
"recurse": true
},
{
"path": "/var/log/kolla/swift",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",
"recurse": true
}
]
}