grafana-ansible-collection/tests/integration/targets/datasource/tasks/main.yml
2022-08-30 12:24:53 +05:30

23 lines
681 B
YAML

- 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"