Stouts.grafana

Stouts.grafana

Build Status Galaxy

This is an Ansible role for managing Grafana.

  • It installs and configures Grafana.

Variables

Below are the variables you can set and their default values:

grafana_enabled: true                       # Whether the role is active
grafana_apt_repository: deb https://packagecloud.io/grafana/stable/debian/ jessie main
grafana_apt_key: https://packagecloud.io/gpg.key

grafana_version: 3.1.1-*                    # Set the version (or use latest for the most recent version)

grafana_app_mode: production

# Paths
grafana_data: /var/lib/grafana
grafana_logs: /var/log/grafana
grafana_plugins: "{{ grafana_data }}/plugins"
grafana_plugins_install: []

# Server settings
grafana_protocol: http
grafana_http_addr: 0.0.0.0                  # IP address to bind to
grafana_http_port: 3000                     # HTTP port to use
grafana_domain: localhost                   # Domain name to access Grafana from a browser
grafana_enforce_domain: false
grafana_root_url: "%(protocol)s://%(domain)s:%(http_port)s/"
grafana_router_logging: false                  # Log web requests
grafana_static_root_path: public            # Relative working path
grafana_enable_gzip: false                     # Enable gzip compression
grafana_cert_file:                          # HTTPS certificate file
grafana_cert_key:

# Database settings
grafana_type: sqlite3                       # Database type: "mysql", "postgres", or "sqlite3"
grafana_host: 127.0.0.1:3306
grafana_name: grafana
grafana_user: root
grafana_password:
grafana_ssl_mode: disable                   # For "postgres" only, options are "disable", "require", or "verify-full"
grafana_path: grafana.db                    # For "sqlite3" only, path relative to data_path

# Session settings
grafana_provider: file                      # Can be "memory", "file", "redis", or "mysql", default is "memory"
grafana_provider_config: sessions
grafana_cookie_name: grafana_sess           # Name for session cookie
grafana_cookie_secure: false                # True if using HTTPS sessions
grafana_session_life_time: 86400            # Session lifetime in seconds, default is 86400

# Analytics settings
grafana_reporting_enabled: true             # Enable server reporting every 24 hours
grafana_check_for_updates: true             # Set to false to disable update checks
grafana_google_analytics_ua_id:             # Google Analytics ID for tracking

# Security settings
grafana_admin_user: admin                   # Default admin username
grafana_admin_password: admin               # Default admin password
grafana_secret_key: ECaamBjja2CChzAp        # Key used for signing
grafana_login_remember_days: 7
grafana_cookie_username: grafana_user
grafana_cookie_remember_name: grafana_remember
grafana_disable_gravatar: false                # Disable Gravatar profile pictures
grafana_data_source_proxy_whitelist:        # Data source proxy whitelist (ip_or_domain:port)

# Snapshots settings
grafana_external_enabled: true
grafana_external_snapshot_url: https://snapshots-origin.raintank.io
grafana_external_snapshot_name: Publish to snapshot.raintank.io

# User settings
grafana_allow_sign_up: true                 # Allow user sign up/registration
grafana_allow_org_create: true              # Allow admin users to create organizations
grafana_auto_assign_org: true                # Automatically assign new users to the default organization
grafana_auto_assign_org_role: Viewer        # Default role for new users
grafana_login_hint: email or username       # Hint text for login page

# Anonymous Access
grafana_anonymous_enabled: false               # Enable anonymous access
grafana_anonymous_org_name: Main Org.       # Organization name for unauthenticated users
grafana_anonymous_org_role: Viewer          # Role for unauthenticated users

# GitHub Authentication
grafana_github_enabled: false                  # Enable GitHub login
grafana_github_client_id: some_id
grafana_github_client_secret: some_secret
grafana_github_scopes: user:email
grafana_github_auth_url: https://github.com/login/oauth/authorize
grafana_github_token_url: https://github.com/login/oauth/access_token
grafana_github_api_url: https://api.github.com/user
grafana_github_team_ids:
grafana_github_allowed_organizations:
grafana_github_auth_allow_sign_up: true

# Google Authentication
grafana_google_enabled: false                  # Enable Google login
grafana_google_client_id: some_id
grafana_google_client_secret: some_secret
grafana_google_scopes: https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
grafana_google_auth_url: https://accounts.google.com/o/oauth2/auth
grafana_google_token_url: https://accounts.google.com/o/oauth2/token
grafana_google_api_url: https://www.googleapis.com/oauth2/v1/userinfo
grafana_google_allowed_domains: mycompany.com othercompany.com
grafana_google_auth_allow_sign_up: true

# Basic Authentication
grafana_auth_basic_enabled: true

# Auth Proxy
grafana_auth_proxy_enabled: false
grafana_auth_proxy_header_name: X-WEBAUTH-USER
grafana_auth_proxy_header_property: username
grafana_auth_proxy_auto_sign_up: true

# LDAP Authentication
grafana_auth_ldap_enabled: false
grafana_auth_ldap_config_file: /etc/grafana/ldap.toml

# SMTP / Email settings
grafana_smtp_enabled: false
grafana_smtp_host: localhost:25
grafana_smtp_user:
grafana_smtp_password:
grafana_smtp_cert_file:
grafana_smtp_key_file:
grafana_smtp_skip_verify: false
grafana_smtp_from_address: [email protected]
grafana_emails_welcome_email_on_sign_up: false

# Logging settings
grafana_log_mode: console, file
grafana_log_buffer_len: 10000
grafana_log_level: Info

# AMPQ Event Publisher
grafana_ampq_enabled: false
grafana_ampq_rabbitmq_url: amqp://localhost/
grafana_ampq_exchange: grafana_events

# Dashboard JSON files
grafana_dashboard_json_enabled: false
grafana_dashboard_json_path: /var/lib/grafana/dashboards

# NGINX configuration setup
grafana_nginx: false
grafana_nginx_servername: "{{inventory_hostname}}"
grafana_nginx_ssl: false
grafana_nginx_ssl_crt: ""
grafana_nginx_ssl_key: ""
grafana_nginx_ssl_redirect: "{{grafana_nginx_ssl}}"
grafana_nginx_port: 80

Usage

To use this role, add Stouts.grafana to your roles and set up the variables in your playbook file. Example:


- hosts: all

  roles:
    - Stouts.grafana

  vars:

License

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

Feedback, bug reports, requests, ...

We encourage your feedback!

If you’d like to show your appreciation for this role, feel free to send a postcard to:

Kirill Klenov
pos. Severny 8-3
MO, Istra, 143500
Russia
Informazioni sul progetto

Installs and setup Grafana metrics dashboard

Installa
ansible-galaxy install Stouts.grafana
Licenza
mit
Download
371.5k
Proprietario
Plump for good