Use macro to avoid repetition
I didn't use a for loop as the logic for omitting the comma for the final element dirties the logic. Change-Id: Id29d5deebcc5126d69a1bd8395e0df989f2081f0
This commit is contained in:
parent
2a2ce059dc
commit
a1c51b73c7
@ -1,6 +1,15 @@
|
||||
{% set fluentd_user = fluentd_binary %}
|
||||
{% set fluentd_dir = '/etc/' ~ fluentd_binary %}
|
||||
|
||||
{%- macro config_directory(dir) -%}
|
||||
{
|
||||
"source": "{{ container_config_directory }}/{{ dir }}",
|
||||
"dest": "{{ fluentd_dir }}/{{ dir }}",
|
||||
"owner": "{{ fluentd_user }}",
|
||||
"perm": "0600"
|
||||
}
|
||||
{%- endmacro -%}
|
||||
|
||||
{% if fluentd_binary == 'fluentd' %}
|
||||
{% set fluentd_conf = 'fluent.conf' %}
|
||||
{% if kolla_base_distro in ['ubuntu', 'debian'] %}
|
||||
@ -22,38 +31,11 @@
|
||||
"owner": "{{ fluentd_user }}",
|
||||
"perm": "0600"
|
||||
},
|
||||
{# Copy all configuration files in input/ directory to include #}
|
||||
{# custom input configs. #}
|
||||
{
|
||||
"source": "{{ container_config_directory }}/input",
|
||||
"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",
|
||||
"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",
|
||||
"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",
|
||||
"dest": "{{ fluentd_dir }}/output",
|
||||
"owner": "{{ fluentd_user }}",
|
||||
"perm": "0600"
|
||||
}
|
||||
{# Copy all files in the following directories #}
|
||||
{{ config_directory("input") }},
|
||||
{{ config_directory("filter") }},
|
||||
{{ config_directory("format") }},
|
||||
{{ config_directory("output") }}
|
||||
],
|
||||
"permissions": [
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user