Skip to content

Instantly share code, notes, and snippets.

@maximecolin maximecolin/all.yml
Last active Sep 14, 2017

Embed
What would you like to do?
Telegraf + InfluxDB + Grafana ansible provisoning with manala.io
_env: prod
##############
# Apt Config #
##############
manala_apt_preferences:
- influxdb@influxdata
- telegraf@influxdata
- grafana@grafana
###################
# Telegraf Config #
###################
manala_telegraf_config:
- agent:
- hostname: "{{ ansible_fqdn }}"
- quiet: true
manala_telegraf_configs_exclusive: true
manala_telegraf_configs:
- file: output_influxdb.conf
template: configs/output_influxdb.conf.j2
config:
- urls: ["http://localhost:8086"]
- database: telegraf
- username: telegraf
- password: password
- file: input_system.conf
template: configs/input_system.conf.j2
- file: input_cpu.conf
template: configs/input_cpu.conf.j2
- file: input_mem.conf
template: configs/input_mem.conf.j2
- file: input_disk.conf
template: configs/input_disk.conf.j2
- file: input_diskio.conf
template: configs/input_disk.conf.j2
- file: input_net.conf
template: configs/input_net.conf.j2
#- file: input_custom.conf
# template: "{{ playbook_dir }}/templates/telegraf/input_custom.conf.j2"
##################
# Grafana Config #
##################
manala_grafana_config:
- security:
- admin_user: foobar
- admin_password: foobar
- users:
- allow_sign_up: false
- server:
- domain: monitoring.maximecolin
###################
# InfluxDB Config #
###################
manala_influxdb_config:
- admin:
- enabled: false
################
# nginx Config #
################
manala_nginx_config_template: config/http.{{ _env }}.j2
manala_nginx_configs_exclusive: true
manala_nginx_configs:
# Grafana
- file: grafana.conf
template: configs/server.{{ _env }}.j2
config:
- server_name: monitoring.maximecolin.dev
- access_log: "{{ manala_nginx_log_dir }}/grafana.access.log"
- error_log: "{{ manala_nginx_log_dir }}/grafana.error.log"
- location /:
- proxy_pass: http://localhost:3000
---
- hosts: all
roles:
- role: manala.apt
- role: manala.influxdb
- role: manala.telegraf
- role: manala.grafana
- role: manala.nginx
- src: manala.nginx
- src: manala.apt
- src: manala.telegraf
- src: manala.influxdb
- src: manala.grafana
---
- hosts: all
roles:
- role: manala.apt
- role: manala.influxdb
- role: manala.telegraf
- role: manala.grafana
- role: manala.nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.