Giter Club home page Giter Club logo

ansible_role_fluentd's Introduction

Role Name

This role installs/configures Fluentd server (no ssl) with elasticsearch plugin and as a syslog source. It increases file descriptors and modifies kernel parameters per Fluentd documentation.

It coul be used with elastic.elasticsearch role. It doesn't handle firewall rules-

Requirements

RedHat/CentOS distribution.

Role Variables

Change fluentd_syslog_bind_address to the logging server IP or 0.0.0.0/0 in order to receive syslog data from other systems.

Default values (defaults/main.yml):

# defaults file for fluentd
## Syslog ip and port to listen for
fluentd_syslog_bind_address: 127.0.0.1
fluentd_syslog_port: 5140
## Forward port to listen for
fluentd_forward_port: 24224
## Debug port to listen for
fluentd_debug_port: 24230
## Elastic host and index
fluentd_elasticsearch_host: localhost
fluentd_elasticsearch_port: 9200
fluentd_elasticsearch_index: fluentd
fluentd_elasticsearch_type: fluentd
## Rsyslog config dir
rsyslog_config_dir: /etc/rsyslog.d

Example Playbook

To install Fluentd server:

- name: Install fluentd
  hosts: logging
  become: yes
  roles:
    - { role: jobcespedes.ansible_role_fluentd, tags: ["fluentd"] }

To configure rsyslog in other system machines for centralized logging

# Centralized rsyslog logging
- name: Centralized rsyslog logging
  hosts: all:!logging
  become: yes
  tags: rsyslogd-to-fluentd
  handlers:
    - name: restart rsyslogd
      service:
        name: rsyslog
        state: restarted
  tasks:
    - name: Install fluentd rsyslog config
      blockinfile:
        dest: '{{ rsyslog_config_dir }}/fluentd.conf'
        create: yes
        state: present
        block: |
          $ActionQueueFileName	fwdFluentd1
          $ActionQueueMaxDiskSpace 1g
          $ActionQueueSaveOnShutdown on
          $ActionQueueType LinkedList
          $ActionResumeRetryCount -1
          *.* @{{ fluentd_syslog_address }}:{{ fluentd_syslog_port }}
      notify: restart rsyslogd

License

Apache License, Version 2.0

Author Information

Job Cespedes: [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.