From 7f056829debba911396d4eb659839195bad8afd4 Mon Sep 17 00:00:00 2001 From: rrey Date: Sun, 26 Nov 2023 01:28:27 +0000 Subject: [PATCH 1/2] Update tested Grafana versions --- .github/workflows/ansible-test.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index fff19d23..85fbc432 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -45,7 +45,7 @@ jobs: strategy: fail-fast: false matrix: - grafana_version: ["9.5.13", "8.5.27", "10.2.0"] + grafana_version: ["9.5.14", "8.5.27", "10.2.2"] ansible_version: ["stable-2.13", "stable-2.14", "devel"] python_version: ["3.10"] services: diff --git a/README.md b/README.md index 1d4ddb2c..cfdfbc98 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Click on the name of a plugin or module to view that content's documentation: We aim at keeping the last 3 Major versions of Grafana tested. This collection is currently testing the modules against following versions of Grafana: ``` -grafana_version: ["9.5.13", "8.5.27", "10.2.0"] +grafana_version: ["9.5.14", "8.5.27", "10.2.2"] ``` ## Installation and Usage From 05271d8edb1b2de095b172d20dae0d42c36b9b9c Mon Sep 17 00:00:00 2001 From: Nemental <15136847+Nemental@users.noreply.github.com> Date: Mon, 6 Nov 2023 12:31:40 +0100 Subject: [PATCH 2/2] docs: added telekom-mms.grafana section --- README.md | 52 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cfdfbc98..9b601a44 100644 --- a/README.md +++ b/README.md @@ -67,12 +67,9 @@ You can either call modules by their Fully Qualified Collection Namespace (FQCN) gather_facts: false connection: local - collections: - - community.grafana - tasks: - name: Ensure Influxdb datasource exists. - grafana_datasource: + community.grafana.grafana_datasource: name: "datasource-influxdb" grafana_url: "https://grafana.company.com" grafana_user: "admin" @@ -93,13 +90,11 @@ In your playbooks, you can set [module defaults](https://github.com/ansible/ansi ```yaml +--- - hosts: localhost gather_facts: false connection: local - collections: - - community.grafana - module_defaults: group/community.grafana.grafana: grafana_url: "https://grafana.company.com" @@ -108,7 +103,7 @@ In your playbooks, you can set [module defaults](https://github.com/ansible/ansi tasks: - name: Ensure Influxdb datasource exists. - grafana_datasource: + community.grafana.grafana_datasource: name: "datasource-influxdb" org_id: "1" ds_type: "influxdb" @@ -118,7 +113,7 @@ In your playbooks, you can set [module defaults](https://github.com/ansible/ansi tls_ca_cert: "/etc/ssl/certs/ca.pem" - name: Create or update a Grafana user - grafana_user: + community.grafana.grafana_user: name: "Bruce Wayne" email: "batman@gotham.city" login: "batman" @@ -126,6 +121,45 @@ In your playbooks, you can set [module defaults](https://github.com/ansible/ansi is_admin: true ``` +## Complementary Collection: [`telekom-mms.grafana`](https://github.com/telekom-mms/ansible-role-grafana) + +The `telekom-mms.grafana` collection is an Ansible Collection that simplifies the use of the `community.grafana` collection. It provides an Ansible Role for easy integration with `community.grafana`. With this collection, you only need to define the variables for your Grafana resources. + +### Requirements + ansible-galaxy collection install telekom-mms.grafana +... or use a requirements.yml: +`ansible-galaxy collection install -r requirements.yml` +```yaml +--- +collections: + - name: telekom-mms.grafana +``` + +### Example Playbook +```yaml +--- +- hosts: localhost + gather_facts: false + connection: local + + vars: + grafana_url: "https://grafana.company.com" + grafana_user: "admin" + grafana_password: "xxxxxx" + + grafana_datasources: + - name: "Loki" + ds_type: "loki" + ds_url: "http://127.0.0.1:3100" + tls_skip_verify: yes + grafana_folders: + - name: my_service + - name: other_service + + roles: + - role: telekom-mms.grafana +``` + ## Testing and Development 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`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths), and work on it there.