Created
July 9, 2019 23:18
Revisions
-
fopina created this gist
Jul 9, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ --- - name: Restart Fluentbit service: name: td-agent-bit enabled: true state: restarted This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ - name: Required variable check fail: msg: "both fluentbit_inputs and fluentbit_outputs variables are required" when: fluentbit_inputs is not defined or fluentbit_outputs is not defined - name: add fluentbit apt key apt_key: url: https://packages.fluentbit.io/fluentbit.key state: present - apt_repository: repo: deb https://packages.fluentbit.io/{{ ansible_lsb.id | lower }}/{{ ansible_lsb.codename }} {{ ansible_lsb.codename }} main state: present filename: fluentbit when: ansible_lsb.codename in ('stretch', 'jessie') and ansible_lsb.id in ('Debian', 'Raspbian') - name: Install td-agent-bit apt: name: td-agent-bit notify: Restart Fluentbit - name: generate td-agent-bit config template: src: td-agent-bit.conf.j2 dest: /etc/td-agent-bit/td-agent-bit.conf notify: Restart Fluentbit This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ [SERVICE] Flush 5 Daemon Off Log_Level info Parsers_File parsers.conf Plugins_File plugins.conf HTTP_Server Off HTTP_Listen 0.0.0.0 HTTP_Port 2020 {% for input in fluentbit_inputs %} {% for input_name, input_props in input.items() %} [INPUT] Name {{ input_name }} {% for prop in input_props %} {% for pk, pv in prop.items() %} {{ pk }} {{ pv }} {% endfor %} {% endfor %} {% endfor %} {% endfor %} {% if fluentbit_filters is defined %} {% for filter in fluentbit_filters %} {% for filter_name, filter_props in filter.items() %} [FILTER] Name {{ filter_name }} {% for prop in filter_props %} {% for pk, pv in prop.items() %} {{ pk }} {{ pv }} {% endfor %} {% endfor %} {% endfor %} {% endfor %} {% endif %} {% for output in fluentbit_outputs %} {% for output_name, output_props in output.items() %} [OUTPUT] Name {{ output_name }} {% for prop in output_props %} {% for pk, pv in prop.items() %} {{ pk }} {{ pv }} {% endfor %} {% endfor %} {% endfor %} {% endfor %}