diff --git a/ansible/roles/common/templates/fluentd.json.j2 b/ansible/roles/common/templates/fluentd.json.j2 index a827dc32b2..0dc78be3db 100644 --- a/ansible/roles/common/templates/fluentd.json.j2 +++ b/ansible/roles/common/templates/fluentd.json.j2 @@ -22,6 +22,14 @@ {% set fluentd_cmd = '/usr/sbin/td-agent' %} {% endif %} +{%- macro config_directory_permissions(dir) -%} + { + "path": "{{ fluentd_dir }}/{{ dir }}", + "owner": "{{ fluentd_user }}:{{ fluentd_user }}", + "perm": "0700" + } +{%- endmacro -%} + { "command": "{{ fluentd_cmd }}", "config_files": [ @@ -52,7 +60,12 @@ "path": "/var/lib/fluentd/data", "owner": "{{ fluentd_user }}:{{ fluentd_user }}", "recurse": true - } + }, + {# Allow Fluentd to read configuration from folders #} + {{ config_directory_permissions("input") }}, + {{ config_directory_permissions("filter") }}, + {{ config_directory_permissions("format") }}, + {{ config_directory_permissions("output") }} ] }