Skip to content

Commit

Permalink
Make required changes for Ansible 2.10
Browse files Browse the repository at this point in the history
* Introduce the antsibull-changelog fragments mechanism
* Remove tests/sanity/requirements.txt that was accidentally introduced
* Generate fragments and changelog from previous releases of the collection

Closes: #112
  • Loading branch information
rrey committed Aug 16, 2020
1 parent 78e72ad commit e0c5a8f
Show file tree
Hide file tree
Showing 19 changed files with 204 additions and 54 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ jobs:
python-version: 3.6

- name: Install ansible-base (devel)
run: pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
run: pip install antsibull-changelog https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check

- name: Run sanity tests
run: ansible-test sanity --docker -v --color --python 3.6

- name: Check changelog fragments syntax
run: antsibull-changelog lint

units:
runs-on: ubuntu-latest
steps:
Expand Down
35 changes: 0 additions & 35 deletions CHANGELOG.md

This file was deleted.

68 changes: 68 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
================================
Grafana Collection Release Notes
================================

.. contents:: Topics


v1.0.0
======

Release Summary
---------------

Stable release for Ansible 2.10 and beyond

Major Changes
-------------

- Add changelog management for ansible 2.10 (#112)
- grafana_datasource ; adding additional_json_data param

Known Issues
------------

- grafana_datasource doesn't set password correctly (#113)
- secureJsonData related properties aren't updated (#107)

v0.2.2
======

Bugfixes
--------

- Fix an issue in `grafana_dashboard` that made dashboard import no more detecting changes and fail.
- Refactor module `grafana_datasource` to ease its support.

v0.2.1
======

Bugfixes
--------

- Fix an issue with `grafana_datasource` idempotency

v0.2.0
======

Minor Changes
-------------

- Add Thruk as Grafana Datasource
- Add `grafana_folder` module
- Add `grafana_user` module
- Use `module_utils` to allow code factorization

Bugfixes
--------

- Fix issue `#45` in `grafana_plugin`

v0.1.0
======

Release Summary
---------------

Initial migration of Grafana content from Ansible core (2.9/devel)

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ The current process for publishing new versions of the Grafana Collection is man

After the version is published, verify it exists on the [Grafana Collection Galaxy page](https://galaxy.ansible.com/community/grafana).

## Changelogs

* Every change that does not only affect docs or tests must have a changelog fragment.
** Exception: fixing/extending a feature that already has a changelog fragment and has not yet been released. Such PRs must always link to the original PR(s) they update.
** Use your common sense!
** (This might change later. The trivial category should then be used to document changes which are not important enough to end up in the text version of the changelog.)
** Fragments must not be added for new module PRs and new plugin PRs. The only exception are test and filter plugins: these are not automatically documented yet.
* The (x+1).0.0 changelog continues the x.0.0 changelog.
** A x.y.0 changelog with y > 0 is not part of a changelog of a later X.*.* (with X > x) or x,Y,* (with Y > y) release.
** A x.y.z changelog with z > 0 is not part of a changelog of a later (x+1).*.* or x.Y.z (with Y > y) release.
Since everything adding to the minor/patch changelogs are backports, the same changelog fragments of these minor/patch releases will be in the next major release's changelog. (This is the same behavior as in ansible/ansible.)
** Changelogs do not contain previous major releases, and only use the ancestor feature (in changelogs/changelog.yaml) to point to the previous major release.
** Changelog fragments are removed after a release is made.

## More Information

For more information about Ansible's Grafana integration, join the `#ansible-community` channel on Freenode IRC, and browse the resources in the [Grafana Working Group](https://github.com/ansible/community/wiki/Grafana) Community wiki page.
Expand Down
50 changes: 50 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
ancestor: null
releases:
0.1.0:
changes:
release_summary: 'Initial migration of Grafana content from Ansible core (2.9/devel)
'
fragments:
- 0.1.0.yml
release_date: '2020-08-12'
0.2.0:
changes:
bugfixes:
- Fix issue `#45` in `grafana_plugin`
minor_changes:
- Add Thruk as Grafana Datasource
- Add `grafana_folder` module
- Add `grafana_user` module
- Use `module_utils` to allow code factorization
fragments:
- 0.2.0.yml
release_date: '2020-08-12'
0.2.1:
changes:
bugfixes:
- Fix an issue with `grafana_datasource` idempotency
fragments:
- 0.2.1.yml
release_date: '2020-08-12'
0.2.2:
changes:
bugfixes:
- Fix an issue in `grafana_dashboard` that made dashboard import no more detecting
changes and fail.
- Refactor module `grafana_datasource` to ease its support.
fragments:
- 0.2.2.yml
release_date: '2020-08-12'
1.0.0:
changes:
known_issues:
- grafana_datasource doesn't set password correctly (#113)
- secureJsonData related properties aren't updated (#107)
major_changes:
- Add changelog management for ansible 2.10 (#112)
- grafana_datasource ; adding additional_json_data param
release_summary: Stable release for Ansible 2.10 and beyond
fragments:
- 1.0.0.yml
release_date: '2020-08-12'
31 changes: 31 additions & 0 deletions changelogs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: true
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Grafana Collection
trivial_section_name: trivial
use_fqcn: true
2 changes: 2 additions & 0 deletions changelogs/fragments/0.1.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
release_summary: |
Initial migration of Grafana content from Ansible core (2.9/devel)
7 changes: 7 additions & 0 deletions changelogs/fragments/0.2.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bugfixes:
- Fix issue `#45` in `grafana_plugin`
minor_changes:
- Add Thruk as Grafana Datasource
- Add `grafana_user` module
- Add `grafana_folder` module
- Use `module_utils` to allow code factorization
2 changes: 2 additions & 0 deletions changelogs/fragments/0.2.1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- Fix an issue with `grafana_datasource` idempotency
3 changes: 3 additions & 0 deletions changelogs/fragments/0.2.2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bugfixes:
- Fix an issue in `grafana_dashboard` that made dashboard import no more detecting changes and fail.
- Refactor module `grafana_datasource` to ease its support.
7 changes: 7 additions & 0 deletions changelogs/fragments/1.0.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
release_summary: Stable release for Ansible 2.10 and beyond
major_changes:
- grafana_datasource ; adding additional_json_data param
- Add changelog management for ansible 2.10 (#112)
known_issues:
- grafana_datasource doesn't set password correctly (#113)
- secureJsonData related properties aren't updated (#107)
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace: community
name: grafana
version: 0.2.2
version: 1.0.0
readme: README.md
authors:
- Rémi REY (@rrey)
Expand Down
2 changes: 2 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
requires_ansible: '>=2.6.0'
8 changes: 4 additions & 4 deletions plugins/modules/grafana_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
connection: local
tasks:
- name: Import Grafana dashboard foo
grafana_dashboard:
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_api_key: "{{ grafana_api_key }}"
state: present
Expand All @@ -96,22 +96,22 @@
path: /path/to/dashboards/foo.json
- name: Import Grafana dashboard Zabbix
grafana_dashboard:
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_api_key: "{{ grafana_api_key }}"
folder: zabbix
dashboard_id: 6098
dashbord_revision: 1
- name: Import Grafana dashboard zabbix
grafana_dashboard:
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_api_key: "{{ grafana_api_key }}"
folder: public
dashboard_url: https://grafana.com/api/dashboards/6098/revisions/1/download
- name: Export dashboard
grafana_dashboard:
community.grafana.grafana_dashboard:
grafana_url: http://grafana.company.com
grafana_user: "admin"
grafana_password: "{{ grafana_password }}"
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/grafana_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
EXAMPLES = '''
---
- name: Create a folder
grafana_folder:
community.grafana.grafana_folder:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
title: "grafana_working_group"
state: present
- name: Delete a folder
grafana_folder:
community.grafana.grafana_folder:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
title: "grafana_working_group"
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/grafana_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
EXAMPLES = '''
---
- name: Install/update Grafana piechart panel plugin
grafana_plugin:
community.grafana.grafana_plugin:
name: grafana-piechart-panel
version: latest
state: present
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/grafana_team.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@
EXAMPLES = '''
---
- name: Create a team
grafana_team:
community.grafana.grafana_team:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
name: "grafana_working_group"
email: "[email protected]"
state: present
- name: Create a team with members
grafana_team:
community.grafana.grafana_team:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
name: "grafana_working_group"
Expand All @@ -87,7 +87,7 @@
state: present
- name: Create a team with members and enforce the list of members
grafana_team:
community.grafana.grafana_team:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
name: "grafana_working_group"
Expand All @@ -99,7 +99,7 @@
state: present
- name: Delete a team
grafana_team:
community.grafana.grafana_team:
url: "https://grafana.example.com"
grafana_api_key: "{{ some_api_token_value }}"
name: "grafana_working_group"
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/grafana_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
EXAMPLES = '''
---
- name: Create or update a Grafana user
grafana_user:
community.grafana.grafana_user:
url: "https://grafana.example.com"
url_username: admin
url_password: changeme
Expand All @@ -86,7 +86,7 @@
state: present
- name: Delete a Grafana user
grafana_user:
community.grafana.grafana_user:
url: "https://grafana.example.com"
url_username: admin
url_password: changeme
Expand Down
4 changes: 0 additions & 4 deletions tests/sanity/requirements.txt

This file was deleted.

0 comments on commit e0c5a8f

Please sign in to comment.