Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,32 @@ Configures the fluent-bit service with upstart/systemd etc
Configures fluent-bit input/output plugins


``fluent-bit.repo``
--------------------

Configures the Fluent Bit repository to install packages from.
Currently works with Debian/Ubuntu and RedHat family (RHEL, CentOS, Rocky, Alma, etc.).


``fluent-bit.repo.clean``
--------------------

Removes the Fluent Bit repository from repositories list.


TODO:
================

- Add repository install
- Expand repository install to support all distributions available in official repository.
- Prepare next gen with (will break old format):
``
bit:
fluent-bit:
config:
flush: 5
bit:
td-agent-bit:
config:
flush: 5
``

.. code-block::

bit:
fluent-bit:
config:
flush: 5
bit:
td-agent-bit:
config:
flush: 5
2 changes: 2 additions & 0 deletions fluent-bit/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

fluent_bit:
pkg: fluent-bit
repo:
keyring: '/usr/share/keyrings/fluentbit-keyring.gpg'
service:
unit: '/lib/systemd/system/fluent-bit.service'
conf: '/etc/td-agent-bit/fluent-bit.conf'
Expand Down
19 changes: 19 additions & 0 deletions fluent-bit/repo/clean.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{% from "fluent-bit/map.jinja" import bit with context %}

{{ bit.pkg }}_repo-absent:
{%- if salt['grains.get']('os_family') == 'RedHat' %}
pkgrepo.absent:
- name: {{ bit.pkg }}

{%- elif salt['grains.get']('os_family') == 'Debian' %}
file.absent:
- name: /etc/apt/sources.list.d/{{ bit.pkg }}.list

{{ bit.pkg }}_repo-keyring-absent:
file.absent:
- name: {{ bit.repo.keyring }}

{%- endif %}
Binary file added fluent-bit/repo/fluentbit-keyring.gpg
Binary file not shown.
5 changes: 5 additions & 0 deletions fluent-bit/repo/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .install
37 changes: 37 additions & 0 deletions fluent-bit/repo/install.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{% from "fluent-bit/map.jinja" import bit with context %}

{% if salt['grains.get']('os_family') == 'Debian' -%}

{{ bit.pkg }}_apt-transport-https:
pkg.installed:
- name: apt-transport-https

{{ bit.pkg }}_keyring:
file.managed:
- name: {{ bit.repo.keyring }}
- source: salt://{{ slspath }}/fluentbit-keyring.gpg
- require_in:
- pkgrepo: {{ bit.pkg }}_repo

{{ bit.pkg }}_repo:
pkgrepo.managed:
- name: deb [ arch={{ grains.osarch }} signedby={{ bit.repo.keyring }} ]
https://packages.fluentbit.io/{{ grains.os|lower }}/{{ grains.oscodename }} {{ grains.oscodename }} main
- file: /etc/apt/sources.list.d/{{ bit.pkg }}.list
- clean_file: True

{% elif salt['grains.get']('os_family') == 'RedHat' %}

{{ bit.pkg }}_repo:
pkgrepo.managed:
- name: {{ bit.pkg }}
- humanname: Fluent Bit
- baseurl: https://packages.fluentbit.io/centos/$releasever/{{ grains.osarch }}/
- gpgcheck: 1
- gpgkey: https://packages.fluentbit.io/fluentbit.key
- gpgautoimport: True

{% endif %}