bodsch.grafana
Ansible Role: grafana
This Ansible role helps you install and set up grafana.
Development for this Ansible role has moved to the Collection bodsch.grafana. This repository will not be maintained anymore.
If you set grafana_version
to latest
, the role will try to install the newest version.
Be careful, as there might be problems between different versions!
The binaries will be installed in /opt/grafana/${grafana_version}
and linked to /usr/sbin
, allowing you to downgrade more safely.
The Grafana archive is downloaded to the Ansible controller, unpacked, and then the binaries are copied to the target system. The location for cache can be set using the environment variable CUSTOM_LOCAL_TMP_DIRECTORY
.
By default, it's ${HOME}/.cache/ansible/grafana
.
If you want to download directly to the target system, you can do so by setting grafana_direct_download
to true
.
Requirements & Dependencies
Ansible Collections:
Install them using:
ansible-galaxy collection install bodsch.core
ansible-galaxy collection install bodsch.scm
or
ansible-galaxy collection install --requirements-file collections.yml
Operating Systems
Tested on:
- Arch Linux
- Debian based
- Debian 10 / 11 / 12
- Ubuntu 20.04 / 22.04
Usage
grafana_version: 9.1.1
# Choose between enterprise or OSS (open-source)
grafana_edition: oss
grafana_urls:
releases: https://github.com/grafana/grafana/releases
downloads: https://dl.grafana.com/{{ grafana_edition }}/release
grafana_system_user: grafana
grafana_system_group: grafana
grafana_config_dir: /etc/grafana
grafana_data_dir: "{{ grafana_config_paths.data }}"
grafana_share_dir: /usr/share/grafana
grafana_log_dir: "{{ grafana_config_paths.logs }}"
grafana_direct_download: false
grafana_provisioning:
enabled: true # Use provisioning if possible (requires Grafana >= 5.0)
keep_synced: false # Remove old provisions if they are no longer referenced
# Location to store these keys
# grafana_api_keys_dir: "{{ lookup('env', 'HOME') }}/grafana/keys"
grafana_datasources: {}
grafana_plugins: []
grafana_alert_notifications: {}
grafana_api: {}
grafana_service_accounts: {}
grafana_config_alerting: {}
grafana_config_analytics: {}
grafana_config_annotations: {}
grafana_config_auth: {}
grafana_config_aws: {}
grafana_config_azure: {}
grafana_config_dashboards: {}
grafana_config_database: {}
grafana_config_dataproxy: {}
grafana_config_datasources: {}
grafana_config_date_formats: {}
grafana_config_emails: {}
grafana_config_enterprise: {}
grafana_config_explore: {}
grafana_config_expressions: {}
grafana_config_external_image_storage: {}
grafana_config_feature_toggles: {}
grafana_config_general: {}
grafana_config_geomap: {}
grafana_config_grafana_com: {}
grafana_config_help: {}
grafana_config_live: {}
grafana_config_log: {}
grafana_config_metrics: {}
grafana_config_panels: {}
grafana_config_paths: {}
grafana_config_plugin: {}
grafana_config_plugins: {}
grafana_config_profile: {}
grafana_config_query_history: {}
grafana_config_quota: {}
grafana_config_rbac: {}
grafana_config_remote_cache: {}
grafana_config_rendering: {}
grafana_config_security: {}
grafana_config_server: {}
grafana_config_smtp: {}
grafana_config_snapshots: {}
grafana_config_tracing: {}
grafana_config_unified_alerting: {}
grafana_config_users: {}
grafana_config_ldap: {}
Contribution
Please read the Contribution guidelines.
Development, Branches (Git Tags)
The master
Branch is my Working Horse—it contains the latest updates and might be unstable!
For a stable version, please use a Tagged Version.
Author and License
- Bodo Schulz
License
FREE SOFTWARE, HELL YEAH!
ansible-galaxy install bodsch.grafana