Git Product home page Git Product logo

ansible-fluentd's Introduction

williamyeh.fluentd for Ansible Galaxy

Circle CI Build Status

Summary

Role name in Ansible Galaxy: williamyeh.fluentd

This Ansible role has the following features for Fluentd:

  • Install td-agent: the stable Fluentd distribution package maintained by Treasure Data, Inc.
  • Install several plugins.
  • Bare bone configuration (real configuration should be left to user's template files; see Usage section below).

Role Variables

Mandatory variables

None.

Optional variables

User-configurable defaults:

# td-agent version; e.g., 2.3.4
# Will install the default (usually the latest stable) version, if not specified.
tdagent_version


# an array of plugins (with latest versions) to be installed
tdagent_plugins

# an dict of plugins (with specified versions) to be installed
# dict fields:
#   - key: memo for this plugin
#   - value:
#     - name:    plugin name
#     - version: plugin version
tdagent_plugins_versions

User-installable configuration files - main configuration:

# conf file (usually td-agent.conf) to be installed,
# relative to `playbook_dir`;
# the file will be copied verbatim
tdagent_conf_copy

# conf file (usually td-agent.conf.j2) to be installed,
# relative to `playbook_dir`;
# the file will be copied through Ansible's template system
tdagent_conf_template

User-installable configuration files - other configurations:

# other conf templates to be installed to "/etc/td-agent/conf.d";
# dict fields:
#   - key: memo for this conf
#   - value:
#     - src:  template file relative to `playbook_dir`
#     - dest: target file relative to `/etc/td-agent/conf.d/`
tdagent_conf_others

Handlers

  • reload td-agent

  • restart td-agent

  • stop td-agent

Usage

Step 1: add role

Add role name williamyeh.fluentd to your playbook file.

Step 2: add variables, if any

Set vars in your playbook file.

Simple example:

---
# file: simple-playbook.yml

- hosts: all

  roles:
    - williamyeh.fluentd

  vars:
    tdagent_plugins:
      - fluent-plugin-multiprocess
      - fluent-plugin-forest
      - fluent-plugin-elasticsearch

    tdagent_plugins_versions:
      prometheus:
        name: fluent-plugin-prometheus
        version: 0.1.2
      flowcounter:
        name: fluent-plugin-flowcounter
        version: 0.4.1

Step 3: copy user's config file, if necessary

More practical example:

---
# file: complex-playbook.yml

- hosts: all

  roles:
    - williamyeh.fluentd

  vars:
    tdagent_plugins:
      - fluent-plugin-multiprocess
      - fluent-plugin-flowcounter
      - fluent-plugin-elasticsearch

    # copy verbatim
    tdagent_conf_copy: "files/td-agent.conf"

    # copy through Ansible's template system
    tdagent_conf_template: "templates/td-agent.conf.j2"

    # other configurations to be copied through Ansible's template system
    tdagent_conf_others:
      prometheus_metrics:
        src:  templates/prometheus.conf.j2
        dest: prometheus.conf

Dependencies

None.

License

Licensed under the MIT License. See the LICENSE file for details.

History

Modified from my Dockerized Fluentd app:

ansible-fluentd's People

Contributors

william-yeh avatar

Watchers

 avatar  avatar

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.