William-Yeh.fluentd

williamyeh.fluentd for Ansible Galaxy

Circle CI Build Status

Summary

Role name in Ansible Galaxy: williamyeh.fluentd

This Ansible role provides several features for Fluentd:

  • Installs td-agent: a stable version of Fluentd managed by Treasure Data, Inc.
  • Installs multiple plugins.
  • Basic configuration (users should provide their own templates; see Usage section below).

Role Variables

Mandatory variables

There are no mandatory variables.

Optional variables

You can configure the following options:

# Version of td-agent; e.g., 2.3.4
# If not specified, the latest stable version will be installed.
tdagent_version

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

# Dictionary of plugins (with specific versions) to be installed
# Structure:
#   - key: description for this plugin
#   - value:
#     - name: plugin name
#     - version: plugin version
tdagent_plugins_versions

For user-defined configuration files - main configuration:

# Configuration file (e.g., td-agent.conf) to be installed,
# relative to `playbook_dir`;
# the file will be copied as is
tdagent_conf_copy

# Configuration file (e.g., td-agent.conf.j2) to be installed,
# relative to `playbook_dir`;
# this file will be processed through Ansible's template system
tdagent_conf_template

For user-defined configuration files - additional configurations:

# Other configuration templates to install in "/etc/td-agent/conf.d";
# Structure:
#   - key: description for this configuration
#   - value:
#     - src: template file relative to `playbook_dir`
#     - dest: target location 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

Include the role name williamyeh.fluentd in your playbook file.

Step 2: Add variables, if needed

Define variables in your playbook file.

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 required

More detailed example:

---
# file: complex-playbook.yml

- hosts: all

  roles:
    - williamyeh.fluentd

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

    # Copy as is
    tdagent_conf_copy: "files/td-agent.conf"

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

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

Dependencies

There are no dependencies.

License

This role is licensed under the MIT License. Refer to the LICENSE file for details.

History

This role was modified from my Dockerized Fluentd application:

Informazioni sul progetto

Install Fluentd (td-agent version)

Installa
ansible-galaxy install William-Yeh.fluentd
Licenza
mit
Download
212.8k
Proprietario