Skip to content

Commit

Permalink
fix: handling of desired default state
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental committed Apr 30, 2024
1 parent fc4f19a commit d0a1ffb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/modules/grafana_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,9 @@ def main():
if ds is None:
grafana_iface.create_datasource(payload)
ds = grafana_iface.datasource_by_name(name)
if ds.get("isDefault") != module.params["is_default"]:
grafana_iface.update_datasource(ds.get("id"), payload)
ds = grafana_iface.datasource_by_name(name)
module.exit_json(
changed=True, datasource=ds, msg="Datasource %s created" % name
)
Expand Down

0 comments on commit d0a1ffb

Please sign in to comment.