fix logic for logstash pipelines

This commit is contained in:
m0duspwnens
2020-02-19 16:02:24 -05:00
parent 54e94676fe
commit 7604853c59
2 changed files with 7 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
{%- for pl in pipelines %}
- pipeline.id: {{ pl }}
path.config: "{{ pipelines[pl].config }}"
path.config: "/usr/share/logstash/pipelines/{{ pl }}/"
{% endfor -%}

View File

@@ -115,13 +115,15 @@ ls_pipeline_{{PL}}:
{% for CONFIGFILE in PIPELINES[PL].config %}
ls_pipeline_{{PL}}_{{CONFIGFILE.split('.')[0]}}:
file.managed:
- name: /opt/so/conf/logstash/pipelines/{{PL}}/{{CONFIGFILE}}
- source: salt://logstash/pipelines/config/{{CONFIGFILE}}
{% if 'jinja' in CONFIGFILE.split('.')[-1] %}
- name: /opt/so/conf/logstash/pipelines/{{PL}}/{{CONFIGFILE | replace(".jinja", "")}}
- template: jinja
{% else %}
- name: /opt/so/conf/logstash/pipelines/{{PL}}/{{CONFIGFILE}}
{% endif %}
- user: 931
- group: 939
{% if 'jinja' in CONFIGFILE.split('.')[-1] %}
- template: jinja
{% endif %}
{% endfor %}
{% endfor %}