diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5385a3f3..bb44be3c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,25 @@ Grafana Collection Release Notes .. contents:: Topics +v1.7.0 +====== + +Minor Changes +------------- + +- Add Quickwit search engine datasource (https://quickwit.io). +- Add parameter `org_name` to `grafana_dashboard` +- Add parameter `org_name` to `grafana_datasource` +- Add parameter `org_name` to `grafana_organization_user` +- Add support for Grafana Tempo datasource type (https://grafana.com/docs/grafana/latest/datasources/tempo/) +- default to true/false in docs and code + +Bugfixes +-------- + +- Add `grafana_organiazion_user` to `action_groups.grafana` +- Fixed orgId handling in diff comparison for `grafana_datasource` if using org_name + v1.6.1 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 0f1f2932..0a778f3b 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -234,3 +234,32 @@ releases: - 300_datasource_prometheus_time_interval.yml - fix-316.yml release_date: '2023-11-05' + 1.7.0: + changes: + bugfixes: + - Add `grafana_organiazion_user` to `action_groups.grafana` + - Fixed orgId handling in diff comparison for `grafana_datasource` if using + org_name + minor_changes: + - Add Quickwit search engine datasource (https://quickwit.io). + - Add parameter `org_name` to `grafana_dashboard` + - Add parameter `org_name` to `grafana_datasource` + - Add parameter `org_name` to `grafana_organization_user` + - Add support for Grafana Tempo datasource type (https://grafana.com/docs/grafana/latest/datasources/tempo/) + - default to true/false in docs and code + fragments: + - 238_checkmode.yml + - 308_datasource_quickwit.yml + - 318-org_users_by_org_name.yml + - 321-action-groups-org-users.yml + - 324_formatting.yml + - 325_linting.yml + - 325_true_false.yml + - 331-dashboard-by-org-name.yml + - 332-datasource-by-org-name.yml + - 335-add-datasource-type-tempo.yml + - 339-lint-black.yml + - 341-lint-ruff.yml + - 342-ruff-findings.yml + - 345-datasource-compare-diff-orgid.yml + release_date: '2024-01-17' diff --git a/changelogs/fragments/345-datasource-compare-diff-orgid.yml b/changelogs/fragments/345-datasource-compare-diff-orgid.yml new file mode 100644 index 00000000..11c21141 --- /dev/null +++ b/changelogs/fragments/345-datasource-compare-diff-orgid.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - Fixed orgId handling in diff comparison for `grafana_datasource` if using org_name diff --git a/galaxy.yml b/galaxy.yml index dbfb2d93..b8560002 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,7 +1,7 @@ --- namespace: community name: grafana -version: 1.6.1 +version: 1.7.0 readme: README.md authors: - RĂ©mi REY (@rrey) diff --git a/plugins/modules/grafana_datasource.py b/plugins/modules/grafana_datasource.py index be631836..37849998 100644 --- a/plugins/modules/grafana_datasource.py +++ b/plugins/modules/grafana_datasource.py @@ -559,9 +559,9 @@ def compare_datasources(new, current, compareSecureData=True): return dict(before=current, after=new) -def get_datasource_payload(data): +def get_datasource_payload(data, org_id=None): payload = { - "orgId": data["org_id"], + "orgId": data["org_id"] if org_id is None else org_id, "name": data["name"], "uid": data["uid"], "type": data["ds_type"], @@ -688,6 +688,7 @@ class GrafanaInterface(object): def __init__(self, module): self._module = module self.grafana_url = base.clean_url(module.params.get("url")) + self.org_id = None # {{{ Authentication header self.headers = {"Content-Type": "application/json"} if module.params.get("grafana_api_key", None): @@ -698,12 +699,12 @@ def __init__(self, module): self.headers["Authorization"] = basic_auth_header( module.params["url_username"], module.params["url_password"] ) - org_id = ( + self.org_id = ( self.organization_by_name(module.params["org_name"]) if module.params["org_name"] else module.params["org_id"] ) - self.switch_organization(org_id) + self.switch_organization(self.org_id) # }}} def _send_request(self, url, data=None, headers=None, method="GET"): @@ -923,7 +924,7 @@ def main(): ds = grafana_iface.datasource_by_name(name) if state == "present": - payload = get_datasource_payload(module.params) + payload = get_datasource_payload(module.params, grafana_iface.org_id) if ds is None: grafana_iface.create_datasource(payload) ds = grafana_iface.datasource_by_name(name)