all: Split up Fluent Bit vars

Instead of defining the common values for Fluent bit inputs, filters,
and outputs directly in the variables used by the _fluent-bit_ role, we
need to split these into reusable pieces.  This way, hosts and groups
that need to use a slightly different pipeline configuration can access
the default values without having to redefine them.
This commit is contained in:
2025-09-15 07:55:43 -05:00
parent 0331a55b3e
commit 75061c4d78

View File

@@ -142,7 +142,7 @@ dnf_automatic_schedule: >-
| string
}} *-*-* 04:00:00 America/Chicago
fluent_bit_filters:
fluent_bit_default_filters:
# Avoid log amplification from logging the result of sending logs!
- name: grep
match: host.fluent-bit.service
@@ -175,21 +175,28 @@ fluent_bit_filters:
- message
- tags
- topic
fluent_bit_outputs:
- name: http
alias: victorialogs
match: host.*
fluent_bit_filters: '{{ fluent_bit_default_filters }}'
fluent_bit_output_template_victorialogs:
host: logs.pyrocufflink.blue
port: 443
tls: true
tls.verify: true
tls.verify_hostname: true
tls.ca_file: /etc/pki/ca-trust/source/anchors/dch-root-ca-r2.crt
uri: /insert/jsonline?_stream_fields=hostname,systemd_unit&_msg_field=message&_time_field=date
format: json_lines
json_date_format: iso8601
log_response_payload: false
- name: http
fluent_bit_output_systemd:
name: http
alias: victorialogs
match: host.*
uri: /insert/jsonline?_stream_fields=hostname,systemd_unit&_msg_field=message&_time_field=date
fluent_bit_output_ntfy:
name: http
alias: ntfy
workers: 1
match: ntfy
@@ -202,3 +209,9 @@ fluent_bit_outputs:
format: json_lines
json_date_key: false
log_response_payload: false
fluent_bit_main_outputs:
- '{{ fluent_bit_output_systemd | combine(fluent_bit_output_template_victorialogs) }}'
- '{{ fluent_bit_output_ntfy }}'
fluent_bit_outputs: '{{ fluent_bit_main_outputs }}'