restructure ansible

This commit is contained in:
Pim Kunis 2023-08-25 13:23:51 +02:00
parent 6dfed51c55
commit 43145f8148
6 changed files with 33 additions and 33 deletions

View file

@ -1,10 +1,40 @@
- name: Install fluentbit - name: Install fluentbit
hosts: hypervisors, vms hosts: hypervisors, vms
pre_tasks: handlers:
- name: restart fluent-bit
systemd:
name: fluent-bit
state: restarted
tasks:
- name: Install packages - name: Install packages
apt: apt:
pkg: gpg pkg: gpg
roles: - name: Install APT key
- {role: fluentbit, tags: fluentbit} apt_key:
url: https://packages.fluentbit.io/fluentbit.key
state: present
- name: Install APT repository
apt_repository:
repo: "deb https://packages.fluentbit.io/debian/{{ ansible_distribution_release }} {{ ansible_distribution_release }} main"
state: present
update_cache: true
- name: Install fluent-bit
apt:
name: fluent-bit
- name: Copy fluent-bit configuration
template:
src: "fluent-bit.conf.j2"
dest: /etc/fluent-bit/fluent-bit.conf
notify: restart fluent-bit
- name: Copy fluent-bit parsers configuration
template:
src: "parsers.conf.j2"
dest: /etc/fluent-bit/parsers.conf
notify: restart fluent-bit

View file

@ -1,4 +0,0 @@
- name: restart fluent-bit
systemd:
name: fluent-bit
state: restarted

View file

@ -1,26 +0,0 @@
- name: Install APT key
apt_key:
url: https://packages.fluentbit.io/fluentbit.key
state: present
- name: Install APT repository
apt_repository:
repo: "deb https://packages.fluentbit.io/debian/{{ ansible_distribution_release }} {{ ansible_distribution_release }} main"
state: present
update_cache: true
- name: Install fluent-bit
apt:
name: fluent-bit
- name: Copy fluent-bit configuration
template:
src: "{{ role_path }}/fluent-bit.conf.j2"
dest: /etc/fluent-bit/fluent-bit.conf
notify: restart fluent-bit
- name: Copy fluent-bit parsers configuration
template:
src: "{{ role_path }}/parsers.conf.j2"
dest: /etc/fluent-bit/parsers.conf
notify: restart fluent-bit