Repository URL to install this package:
|
Version:
6.0.0 ▾
|
| .. |
| changelogs |
| meta |
| plugins |
| CHANGELOG.rst |
| FILES.json |
| LICENSE |
| MANIFEST.json |
| README.md |
| codecov.yml |
This repo hosts the community.grafana Ansible Collection.
The collection includes a variety of Ansible content to help automate the management of resources in Grafana.
Click on the name of a plugin or module to view that content's documentation:
We aim at keeping the last 3 minor versions (at least) of Grafana tested.
This collection is currently testing the modules against Grafana versions 7.0.6, 7.1.3 and 8.1.2.
Before using the Grafana collection, you need to install it with the Ansible Galaxy CLI:
ansible-galaxy collection install community.grafana
You can also include it in a requirements.yml file and install it via ansible-galaxy collection install -r requirements.yml, using the format:
--- collections: - name: community.grafana version: 1.3.1
You can either call modules by their Fully Qualified Collection Namespace (FQCN), like community.grafana.grafana_datasource, or you can call modules by their short name if you list the community.grafana collection in the playbook's collections, like so:
--- - hosts: localhost gather_facts: false connection: local collections: - community.grafana tasks: - name: Ensure Influxdb datasource exists. grafana_datasource: name: "datasource-influxdb" grafana_url: "https://grafana.company.com" grafana_user: "admin" grafana_password: "xxxxxx" org_id: "1" ds_type: "influxdb" ds_url: "https://influx.company.com:8086" database: "telegraf" time_interval: ">10s" tls_ca_cert: "/etc/ssl/certs/ca.pem"
For documentation on how to use individual modules and other content included in this collection, please see the links in the 'Included content' section earlier in this README.
In your playbooks, you can set module defaults for the community.grafana.grafana group to avoid repeating the same parameters (e.g., grafana_url, grafana_user, grafana_password) in your tasks:
- hosts: localhost gather_facts: false connection: local collections: - community.grafana module_defaults: group/community.grafana.grafana: grafana_url: "https://grafana.company.com" grafana_user: "admin" grafana_password: "xxxxxx" tasks: - name: Ensure Influxdb datasource exists. grafana_datasource: name: "datasource-influxdb" org_id: "1" ds_type: "influxdb" ds_url: "https://influx.company.com:8086" database: "telegraf" time_interval: ">10s" tls_ca_cert: "/etc/ssl/certs/ca.pem" - name: Create or update a Grafana user grafana_user: name: "Bruce Wayne" email: "batman@gotham.city" login: "batman" password: "robin" is_admin: true
If you want to develop new content for this collection or improve what's already here, the easiest way to work on the collection is to clone it into one of the configured COLLECTIONS_PATHS, and work on it there.
ansible-testThe tests directory contains configuration for running sanity and integration tests using ansible-test.
You can run the collection's test suites with the commands:
ansible-test sanity --docker -v --color
ansible-test units --docker -v --color
ansible-test integration --docker -v --color
The current process for publishing new versions of the Grafana Collection is manual, and requires a user who has access to the community.grafana namespace on Ansible Galaxy to publish the build artifact.
Ensure CHANGELOG.md contains all the latest changes.
Update galaxy.yml and this README's requirements.yml example with the new version for the collection.
Tag the version in Git and push to GitHub.
Run the following commands to build and release the new version on Galaxy:
ansible-galaxy collection build
ansible-galaxy collection publish ./community-grafana-$VERSION_HERE.tar.gz
After the version is published, verify it exists on the Grafana Collection Galaxy page.
See antsibull-changelog documentation
For more information about Ansible's Grafana integration, join the #ansible-community channel on irc.libera.chat, and browse the resources in the Grafana Working Group Community wiki page.
GNU General Public License v3.0 or later
See LICENCE to see the full text.
Any contribution is welcome and we only ask contributors to:
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!