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

25 lines
687 B
YAML
Raw Normal View History

2023-03-03 09:53:02 +01:00
---
- name: Create/Update a Data Source
grafana.grafana.datasource:
2023-03-03 09:53:02 +01:00
dataSource:
name: ansible-integration
type: influxdb
url: https://grafana.github.com/grafana-ansible-collection
user: user
secureJsonData:
2023-03-03 09:53:02 +01:00
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
2023-03-03 09:53:02 +01:00
- name: Create Check
ansible.builtin.assert:
that:
- create_result.changed == true
2023-03-03 09:53:02 +01:00
- create_result.output.message == "Datasource added" or create_result.output.message == "Datasource updated"