Git Product home page Git Product logo

ansible-role-influxdb's Introduction

Moved to https://github.com/mediafellows/ansible-role-influxdb

Build Status

Ansible InfluxDB server role

Role that sets up a complete TICK stack server (not installing telegraf). It will install a complete setup of InfluxDB, Chronograf and Kapacitor.

This role is meant for a server that receives metrics from the Telegraf agent and stores them in InfluxDB to allow monitoring and alerting through Chronograf and Kapacitor all on one host. Chronograf will be configured with Github OAuth to protect from public access.

If you also want to install Telegraf, there is a seperate role mediapeers.telegraf that can be used on all machines that you want monitored.

Requirements

Ubuntu 16.04 or newer as OS. Other distros might also work, but they should have the package python-influxdb available in their apt repos. This pacakge is needed as a depedendency for the Ansible influxdb modules to work.

If you use Ansible version below 2.6 you might also have to add influxdb modules to your Ansible project library dir (usually ./libary/). Find them at https://github.com/ansible/ansible/tree/devel/lib/ansible/modules/database/influxdb

Also open port 8888 to expose Chronograf to the outside world or another port if you change the config or put a webserver (reverse proxy) infront of it.

Role Variables

Role variables you should change:

  • chronograf_public_url: https://some-url.com - Publicly reachable URL of chronograf setup.
  • influxdb_admin_pw: secret_pw - set your own PW for InfluxDB admin user
  • influxdb_chronograf_pw: secret_pw - set your own PW for InfluxDB chronograf user (for reading data)
  • influxdb_telegraf_pw: secret_pw - set your own PW for InfluxDB telegraf user (for ingesting data)
  • influxdb_chronograf_oauth_secret: abc123def - Random string used as encryption salt.
  • influxdb_chronograf_oauth_github_id: abc123 - OAuth app id provided by Github after creating one.
  • influxdb_chronograf_oauth_github_secret: abc123 - OAauth app secret provided by Github
  • influxdb_chronograf_oauth_github_org: myorg - Restrict this to your Github org, make sure your OAuth app is owned by this org.

Optionally you can change more params, see defaults/main.yml for details.

Some useful variables to restore state from existing DB backups:

  • influxdb_meta_backup: /some/path/to/influxdb_backup/meta.00 - Path to local InfluxDB meta DB backup file, which will be copied to InfluxDB instance and restored. Will replace all other DB setup (users, tables etc.)
  • influxdb_chronograf_db_backup: /some/path/chronograf-v1.db - Path to local Chronograf settings DB file. Usually contains settings such as Influx sources and Chronograf auth users
  • influxdb_kapacitor_db_backup: /some/path/kapacitor.db - Path to local Kapacitor settings DB file. Usually contains alertings settings/TICK scripts etc.

Dependencies

Depends on no other role

Example Playbook

Example role integration into your play:

- hosts: servers
  become: true
  vars:
    influxdb_port: 123
  roles:
     - mediapeers.influxdb
  tasks:
    # other tasks

License

BSD, as-is.

Author Information

Stefan Horning [email protected]

ansible-role-influxdb's People

Contributors

stefanhorning avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-influxdb's Issues

[FAILED]:::TASK [mediapeers.ansible-role-influxdb : Add InfluxData repository]

Hey ho,

I tried to deploy influxdb with your ansible role and this error appears.
Maybe its on my side, maybe on yours. I just want to let you know and maybe you have an idea how to fix it.

docker: TASK [mediapeers.ansible-role-influxdb : Add InfluxData repository] ************
    docker: An exception occurred during task execution. To see the full traceback, use -vvv. The error was: apt.cache.FetchFailedException: E:The method driver /usr/lib/apt/methods/https could not be found., W:Is the package apt-transport-https installed?, E:Failed to fetch https://repos.influxdata.com/ubuntu/dists/xenial/InRelease  , E:Some index files failed to download. They have been ignored, or old ones used instead.
    docker: fatal: [127.0.0.1]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_txayrW/ansible_module_apt_repository.py\", line 550, in <module>\n    main()\n  File \"/tmp/ansible_txayrW/ansible_module_apt_repository.py\", line 542, in main\n    cache.update()\n  File \"/usr/lib/python2.7/dist-packages/apt/cache.py\", line 487, in update\n    raise FetchFailedException(e)\napt.cache.FetchFailedException: E:The method driver /usr/lib/apt/methods/https could not be found., W:Is the package apt-transport-https installed?, E:Failed to fetch https://repos.influxdata.com/ubuntu/dists/xenial/InRelease  , E:Some index files failed to download. They have been ignored, or old ones used instead.\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}

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.