- name: Create/Update a Data Source
grafana.grafana.datasource:
dataSource: {
name: "ansible-integration",
type: "influxdb",
url: "https://grafana.github.com/grafana-ansible-collection",
user: "user",
secureJsonData:
{ password: "password" },
database: "db-name",
id: 123,
uid: "ansibletest",
access: "proxy"
}
stack_slug: "{{ stack_name }}"
grafana_api_key: "{{ grafana_api_key }}"
state: present
register: create_result
- assert:
that:
- create_result.changed == true
- create_result.output.message == "Datasource added" or create_result.output.message == "Datasource updated"