Skip to content

Commit

Permalink
Merge branch 'main' into auto-bump-grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental authored Aug 12, 2024
2 parents 6e9539f + 03a9783 commit f241d0f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ 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.

## Communication

* Join the Ansible forum:
* [Get Help](https://forum.ansible.com/c/help/6): get help or help others.
* [Posts tagged with 'grafana'](https://forum.ansible.com/tag/grafana): subscribe to participate in collection-related conversations.
* [Ansible Forum Group 'grafana-collection'](https://forum.ansible.com/g/grafana-collection): by joining the team you will automatically get subscribed to the posts tagged with [grafana](https://forum.ansible.com/tag/grafana).
* [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
* [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.

* The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.

For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).

## Included content

Click on the name of a plugin or module to view that content's documentation:
Expand Down
3 changes: 3 additions & 0 deletions changelogs/fragments/0-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- README.md - Add Communication section with Forum information.
3 changes: 3 additions & 0 deletions changelogs/fragments/396-datasource-diff-apiversion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- Remove field `apiVersion` from return of current `grafana_datasource` for working diff
43 changes: 24 additions & 19 deletions plugins/modules/grafana_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,25 +537,30 @@


def compare_datasources(new, current, compareSecureData=True):
if new["uid"] is None:
del current["uid"]
del new["uid"]
del current["typeLogoUrl"]
del current["id"]
if "version" in current:
del current["version"]
if "readOnly" in current:
del current["readOnly"]
if current["basicAuth"] is False:
if "basicAuthUser" in current:
del current["basicAuthUser"]
if "password" in current:
del current["password"]
if "basicAuthPassword" in current:
del current["basicAuthPassword"]
if current["type"] == "grafana-postgresql-datasource" and new["type"] == "postgres":
del current["type"]
del new["type"]
if new.get("uid") is None:
new.pop("uid", None)
current.pop("uid", None)

for field in [
"apiVersion",
"basicAuthPassword",
"id",
"password",
"readOnly",
"typeLogoUrl",
"version",
]:
current.pop(field, None)

if not current.get("basicAuth", True):
current.pop("basicAuthUser", None)

if (
current.get("type") == "grafana-postgresql-datasource"
and new.get("type") == "postgres"
):
new.pop("type", None)
current.pop("type", None)

# check if secureJsonData should be compared
if not compareSecureData:
Expand Down

0 comments on commit f241d0f

Please sign in to comment.