Debian Codegraph @

ansible_collections/community/grafana/tests/integration/targets/grafana_dashboard/tasks/dashboard-from-url.yml

raw symbols SCIP
1 ---
2 - name: Create Dashboard from URL | check mode | dashboard does not exist
3 community.grafana.grafana_dashboard:
4 state: present
5 commit_message: Updated by ansible
6 dashboard_url: https://grafana.com/api/dashboards/6098/revisions/1/download
7 overwrite: true
8 check_mode: true
9 register: dfu_result1
10 - ansible.builtin.assert:
11 that:
12 - dfu_result1.failed == false
13 - dfu_result1.changed == true
14 - dfu_result1.uid is not defined
15 - dfu_result1.msg == 'Dashboard Zabbix Host Status will be created'
16
17 - name: Create Dashboard from URL | run mode | dashboard does not exist
18 community.grafana.grafana_dashboard:
19 state: present
20 commit_message: Updated by ansible
21 dashboard_url: https://grafana.com/api/dashboards/6098/revisions/1/download
22 overwrite: true
23 check_mode: false
24 register: dfu_result2
25 - ansible.builtin.assert:
26 that:
27 - dfu_result2.failed == false
28 - dfu_result2.changed == true
29 - dfu_result2.uid is defined
30 - dfu_result2.uid is string
31 - dfu_result2.msg == 'Dashboard Zabbix Host Status created'
32
33 - name: Create Dashboard from URL | check mode | dashboard exists
34 community.grafana.grafana_dashboard:
35 state: present
36 commit_message: Updated by ansible
37 dashboard_url: https://grafana.com/api/dashboards/6098/revisions/1/download
38 overwrite: true
39 check_mode: true
40 register: dfu_result3
41 - ansible.builtin.assert:
42 that:
43 - dfu_result3.failed == false
44 - dfu_result3.changed == false
45 - dfu_result3.uid is defined
46 - dfu_result3.uid is string
47 - dfu_result3.msg == 'Dashboard Zabbix Host Status unchanged.'
48
49 - name: Create Dashboard from URL | run mode | dashboard exists
50 community.grafana.grafana_dashboard:
51 state: present
52 commit_message: Updated by ansible
53 dashboard_url: https://grafana.com/api/dashboards/6098/revisions/1/download
54 overwrite: true
55 check_mode: false
56 register: dfu_result4
57 - ansible.builtin.assert:
58 that:
59 - dfu_result4.failed == false
60 - dfu_result4.changed == false
61 - dfu_result4.uid is defined
62 - dfu_result4.uid is string
63 - dfu_result4.msg == 'Dashboard Zabbix Host Status unchanged.'
64
65 - ansible.builtin.include_tasks:
66 file: delete-dashboard.yml
67 vars:
68 uid_to_delete: '{{ dfu_result4.uid }}'