grafana-ansible-collection/tests/integration/targets/datasource/tasks/main.yml

23 lines
681 B
YAML
Raw Normal View History

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