Adding first 8 modules

This commit is contained in:
Ishan Jain 2022-08-09 12:08:20 +05:30
parent f71f99f999
commit b81aa36c3f
2 changed files with 161 additions and 0 deletions

98
README.md Normal file
View File

@ -0,0 +1,98 @@
# Ansible Collection - grafana.grafana
This collection contains modules and plugins to assist in automating managing of resources in Grafana with Ansible.
## Installation and Usage
### Requirements
The collection is tested and supported with:
* ansible >= 2.13.1
* python >= 3.10
## Installing the collection from Ansible Galaxy
Before using the Grafana collection, you need to install it with the Ansible Galaxy CLI:
```shell
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:
```yaml
---
collections:
- name: grafana.grafana
```
A specific version of the collection can be installed by using the version keyword in the requirements.yml file:
```yaml
---
collections:
- name: amazon.aws
version: 0.0.1
```
## Using this collection
You can call modules by their Fully Qualified Collection Namespace (FQCN), such as `grafana.grafana.cloud_stack`:
```yaml
- 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
```yaml
- 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`](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths),
and work on it there.
### Testing with `ansible-test`
We use `ansible-test` for sanity.
## More information
- [Ansible Collection overview](https://github.com/ansible-collections/overview)
- [Ansible User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html)
- [Ansible Developer guide](https://docs.ansible.com/ansible/latest/dev_guide/index.html)
- [Ansible Collection Developer Guide](https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html)
- [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
## License
GPL-3.0-or-later

63
galaxy.yml Normal file
View File

@ -0,0 +1,63 @@
### REQUIRED
# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
# underscores or numbers and cannot contain consecutive underscores
namespace: grafana
# The name of the collection. Has the same character restrictions as 'namespace'
name: grafana
# The version of the collection. Must be compatible with semantic versioning
version: 0.0.1
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
- Ishan Jain <ishan.jain@grafana.com>
### OPTIONAL but strongly recommended
# A short summary description of the collection
description: Ansible collection to manage resources in Grafana
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
license:
- GPL-2.0-or-later
# The path to the license file for the collection. This path is relative to the root of the collection. This key is
# mutually exclusive with 'license'
license_file: ''
# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
# requirements as 'namespace' and 'name'
tags: []
# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
# collection label 'namespace.name'. The value is a version range
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ','
dependencies: {}
# The URL of the originating SCM repository
repository: https://github.com/grafana/ansible-collection
# The URL to any online docs
documentation: http://docs.example.com
# The URL to the homepage of the collection/project
homepage: http://example.com
# The URL to the collection issue tracker
issues: http://example.com/issue/tracker
# A list of file glob-like patterns used to filter any files or directories that should not be included in the build
# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This
# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry',
# and '.git' are always filtered
build_ignore:
- .idea