Debian Codegraph @

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

raw symbols SCIP
1 ---
2 - name: Create Dashboard from ID | check mode | dashboard does not exist
3 community.grafana.grafana_dashboard:
4 state: present
5 commit_message: Updated by ansible
6 dashboard_id: "1860"
7 dashboard_revision: "1"
8 overwrite: true
9 uid: "dfi"
10 check_mode: true
11 register: dfi_result1
12 - ansible.builtin.assert:
13 that:
14 - dfi_result1.failed == false
15 - dfi_result1.changed == true
16 - dfi_result1.uid is not defined
17 - dfi_result1.msg == 'Dashboard Node Exporter Full will be created'
18
19 - name: Create Dashboard from ID | run mode | dashboard does not exist
20 community.grafana.grafana_dashboard:
21 state: present
22 commit_message: Updated by ansible
23 dashboard_id: "1860"
24 dashboard_revision: "1"
25 overwrite: true
26 uid: "dfi"
27 check_mode: false
28 register: dfi_result2
29 - ansible.builtin.assert:
30 that:
31 - dfi_result2.failed == false
32 - dfi_result2.changed == true
33 - dfi_result2.uid is truthy
34 - dfi_result2.uid == 'dfi'
35 - dfi_result2.msg == 'Dashboard Node Exporter Full created'
36
37 - name: Create Dashboard from ID | check mode | dashboard exists
38 community.grafana.grafana_dashboard:
39 state: present
40 commit_message: Updated by ansible
41 dashboard_id: "1860"
42 dashboard_revision: "1"
43 overwrite: true
44 uid: "dfi"
45 check_mode: true
46 register: dfi_result3
47 - ansible.builtin.assert:
48 that:
49 - dfi_result3.failed == false
50 - dfi_result3.changed == false
51 - dfi_result3.uid is truthy
52 - dfi_result3.uid == 'dfi'
53 - dfi_result3.msg == 'Dashboard Node Exporter Full unchanged.'
54
55 - name: Create Dashboard from ID | run mode | dashboard exists
56 community.grafana.grafana_dashboard:
57 state: present
58 commit_message: Updated by ansible
59 dashboard_id: "1860"
60 dashboard_revision: "1"
61 overwrite: true
62 uid: "dfi"
63 check_mode: false
64 register: dfi_result4
65 - ansible.builtin.assert:
66 that:
67 - dfi_result4.failed == false
68 - dfi_result4.changed == false
69 - dfi_result4.uid is truthy
70 - dfi_result4.uid == 'dfi'
71 - dfi_result4.msg == 'Dashboard Node Exporter Full unchanged.'
72
73 - ansible.builtin.include_tasks:
74 file: delete-dashboard.yml
75 vars:
76 uid_to_delete: '{{ dfi_result4.uid }}'