Skip to content

Commit

Permalink
test: move grafana auth variables to playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental committed Aug 16, 2024
1 parent 1a9c283 commit d43ee63
Show file tree
Hide file tree
Showing 16 changed files with 5 additions and 204 deletions.
5 changes: 5 additions & 0 deletions tests/integration/targets/grafana_datasource/site.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
- name: Run tests for grafana_datasource
hosts: localhost
module_defaults:
community.grafana.grafana_datasource:
grafana_url: http://grafana:3000
grafana_user: admin
grafana_password: admin
tasks:
- ansible.builtin.include_role:
name: ../../grafana_datasource
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
register: result
grafana_datasource:
name: datasource-alertmanager
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: '1'
ds_type: alertmanager
ds_url: alertmanager.company.com:9093
Expand All @@ -23,9 +20,6 @@
register: result
grafana_datasource:
name: datasource-alertmanager
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: '1'
ds_type: alertmanager
ds_url: alertmanager.company.com:9093
Expand Down Expand Up @@ -54,9 +48,6 @@
register: result
grafana_datasource:
name: datasource-alertmanager
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- debug:
Expand All @@ -71,9 +62,6 @@
register: result
grafana_datasource:
name: datasource-alertmanager
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- debug:
Expand Down
12 changes: 0 additions & 12 deletions tests/integration/targets/grafana_datasource/tasks/azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-azure
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: grafana-azure-monitor-datasource
ds_url: http://example.com
Expand Down Expand Up @@ -42,9 +39,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-azure
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: grafana-azure-monitor-datasource
ds_url: http://example.com
Expand Down Expand Up @@ -80,9 +74,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-azure
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: grafana-azure-monitor-datasource
ds_url: http://example.com
Expand All @@ -104,9 +95,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-azure
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: grafana-azure-monitor-datasource
ds_url: http://example.com
Expand Down
12 changes: 0 additions & 12 deletions tests/integration/targets/grafana_datasource/tasks/cloudwatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-cloudwatch
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: cloudwatch
ds_url: http://monitoring.us-west-1.amazonaws.com
Expand Down Expand Up @@ -43,9 +40,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-cloudwatch
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: cloudwatch
ds_url: http://monitoring.us-west-1.amazonaws.com
Expand Down Expand Up @@ -82,9 +76,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-cloudwatch
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.debug:
Expand All @@ -99,9 +90,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-cloudwatch
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.debug:
Expand Down
30 changes: 0 additions & 30 deletions tests/integration/targets/grafana_datasource/tasks/elastic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
community.grafana.grafana_datasource:
name: datasource/elasticLegacy
uid: myuid
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: elasticsearch
ds_url: https://elastic.company.com:9200
Expand Down Expand Up @@ -50,9 +47,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource/elastic
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: elasticsearch
ds_url: https://elastic.company.com:9200
Expand Down Expand Up @@ -96,9 +90,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource/elastic
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: elasticsearch
ds_url: https://elastic.company.com:9200
Expand Down Expand Up @@ -141,9 +132,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource/elastic
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: elasticsearch
ds_url: https://elastic.example.com:9200
Expand Down Expand Up @@ -186,9 +174,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource/elastic
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: elasticsearch
ds_url: https://elastic.example.com:9200
Expand Down Expand Up @@ -237,9 +222,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource/elastic
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: elasticsearch
ds_url: https://elastic.example.com:9200
Expand Down Expand Up @@ -290,9 +272,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource/elasticLegacy
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.assert:
Expand All @@ -303,9 +282,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource/elasticLegacy
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.assert:
Expand All @@ -316,9 +292,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource/elastic
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.assert:
Expand All @@ -329,9 +302,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource/elastic
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.assert:
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/targets/grafana_datasource/tasks/errors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-postgres
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
ignore_errors: true

- ansible.builtin.debug:
Expand Down
12 changes: 0 additions & 12 deletions tests/integration/targets/grafana_datasource/tasks/influx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-influxdb
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: influxdb
ds_url: https://influx.company.com:8086
Expand All @@ -25,9 +22,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-influxdb
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: influxdb
ds_url: https://influx.company.com:8086
Expand Down Expand Up @@ -60,9 +54,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-influxdb
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.debug:
Expand All @@ -76,9 +67,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-influxdb
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.debug:
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/targets/grafana_datasource/tasks/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource/elastic
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: elasticsearch
ds_url: https://elastic.company.com:9200
Expand Down
12 changes: 0 additions & 12 deletions tests/integration/targets/grafana_datasource/tasks/loki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-loki
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: loki
ds_url: https://loki.company.com:3100
Expand All @@ -22,9 +19,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-loki
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: loki
ds_url: https://loki.company.com:3100
Expand Down Expand Up @@ -53,9 +47,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-loki
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.debug:
Expand All @@ -70,9 +61,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-loki
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.debug:
Expand Down
12 changes: 0 additions & 12 deletions tests/integration/targets/grafana_datasource/tasks/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-postgres
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: postgres
ds_url: postgres.company.com:5432
Expand All @@ -28,9 +25,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-postgres
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
org_id: "1"
ds_type: postgres
ds_url: postgres.company.com:5432
Expand Down Expand Up @@ -65,9 +59,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-postgres
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.debug:
Expand All @@ -81,9 +72,6 @@
register: result
community.grafana.grafana_datasource:
name: datasource-postgres
grafana_url: "{{ grafana_url }}"
grafana_user: "{{ grafana_username }}"
grafana_password: "{{ grafana_password }}"
state: absent

- ansible.builtin.debug:
Expand Down
Loading

0 comments on commit d43ee63

Please sign in to comment.