grafana.grafana Ansible collection provides modules for managing various resources on Grafana Cloud
Go to file
2023-04-13 18:15:04 +00:00
.github/workflows Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
changelogs Release 2.0.0 with Agent Role Updates 2023-03-27 10:06:27 +05:30
examples Fix logging section in agent-send-to-grafana-cloud.yaml 2023-04-06 14:14:16 +05:30
meta Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
plugins/modules Fix failing CI for grafana.grafana.folder module (#31) 2023-02-08 15:05:28 +05:30
roles/grafana_agent Configurable agent user groups 2023-04-10 11:09:52 +05:30
tests/integration Update main.yml 2023-03-03 15:12:06 +05:30
tools Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
.ansible-lint Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
.editorconfig Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
.gitignore Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
.markdownlint.yaml Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
.shellcheckrc Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
.textlintrc Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
.yamllint Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
ansible.cfg Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
CHANGELOG.rst Release 2.0.0 with Agent Role Updates 2023-03-27 10:06:27 +05:30
galaxy.yml Release 2.0.0 with Agent Role Updates 2023-03-27 10:06:27 +05:30
LICENSE Adding License details 2022-08-09 12:13:52 +05:30
Makefile Searching for bugs, nothing to see here.... (bbcpmn) 2023-04-13 18:15:04 +00:00
package.json Searching for bugs, nothing to see here.... (bbcpmn) 2023-04-13 18:15:04 +00:00
Pipfile Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
Pipfile.lock Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
README.md Release 2.0.0 with Agent Role Updates 2023-03-27 10:06:27 +05:30
requirements.txt Lint Support and Role Updates 2023-03-03 14:23:02 +05:30
yarn.lock Lint Support and Role Updates 2023-03-03 14:23:02 +05:30

Ansible Collection for Grafana Cloud

Grafana Ansible Collection GitHub tag GitHub Last Commit GitHub Contributors

Lint CI Tests Full Integration Test

This collection (grafana.grafana) contains modules and plugins to assist in automating managing of resources in Grafana Cloud with Ansible.

Ansible version compatibility

The collection is tested and supported with: ansible >= 2.9

Installing the collection

Before using the Grafana collection, you need to install it using the below command:

ansible-galaxy collection install grafana.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: grafana.grafana

A specific version of the collection can be installed by using the version keyword in the requirements.yml file:

---
collections:
  - name: grafana.grafana
    version: 1.0.0

Using this collection

You can call modules by their Fully Qualified Collection Namespace (FQCN), such as grafana.grafana.cloud_stack:

- name: Using grafana collection
  hosts: localhost
  tasks:
    - name: Create a Grafana Cloud stack
      grafana.grafana.cloud_stack:
        name: mystack
        stack_slug: mystack
        org_slug: myorg
        cloud_api_key: "{{ cloud_api_key }}"
        region: eu
        state: present

or you can add full namespace and collection name in the collections element in your playbook

- name: Using grafana collection
  hosts: localhost
  collection:
    - grafana.grafana
  tasks:
    - name: Create a Grafana Cloud stack
      cloud_stack:
        name: mystack
        stack_slug: mystack
        org_slug: myorg
        cloud_api_key: "{{ cloud_api_key }}"
        region: eu
        state: present

Contributing

We are accepting GitHub pull requests and issues. There are many ways in which you can participate in the project, for example:

  • Submit bugs and feature requests, and help us verify them
  • Submit and review source code changes in GitHub pull requests
  • Add new modules for more Grafana resources

Testing and Development

If you want to develop new content for this collection or improve what is 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.

Testing with ansible-test

We use ansible-test for sanity.

Commands

Command Description
make setup Checks to see if necessary tools are installed
make install Installs project dependencies
make lint Performs all linting commands
make lint-sh / make lint-shell Performs shell script linting
make lint-md / make lint-markdown Performs Markdown linting
make lint-txt / make lint-text Performs text linting
make lint-yml / make lint-yaml Performs Yaml linting
make lint-ec / make lint-editorconfig Performs EditorConfig Checks
make lint-ansible Performs Ansible linting
make clean Removes the ./node_modules and ./build directories
make reinstall Shortcut to make clean and make install

Releasing, Versioning and Deprecation

This collection follows Semantic Versioning. More details on versioning can be found in the Ansible docs.

We plan to regularly release new minor or bugfix versions once new features or bugfixes have been implemented.

Releasing the current major version on GitHub happens from the main branch by the GitHub Release Workflow. Before the GitHub Release Workflow is run, Contributors should push the new version on Ansible Galaxy Manually.

We currently are not planning any deprecations or new major releases. The current landscape includes minor version updates for module's documentation in 2.0.1.

To generate changelogs for a new release, Refer Generating Changelogs

To generate the tarball to be uploaded on Ansible Galaxy, Refer Building collection tarball

Code of Conduct

This collection follows the Ansible project's Code of Conduct. Please read and familiarize yourself with this doc

More information

License

GPL-3.0-or-later