Debian Codegraph @

ansible_collections/community/zabbix/tests/integration/targets/test_zabbix_templategroup/tasks/main.yml

raw symbols SCIP
1 ---
2 - name: test - do not run tests for Zabbix = 6.0
3 meta: end_play
4 when: zabbix_version is version('6.0', '=')
5
6 - name: test - create new Zabbix template group
7 community.zabbix.zabbix_templategroup:
8 template_groups:
9 - zbxtempgrp_example_group01
10 state: present
11 register: zbxtempgrp_new
12
13 - name: assert that group was created
14 ansible.builtin.assert:
15 that: zbxtempgrp_new is changed
16
17 - name: test - create same Zabbix template group once again
18 community.zabbix.zabbix_templategroup:
19 template_groups:
20 - zbxtempgrp_example_group01
21 state: present
22 register: zbxtempgrp_existing
23
24 - name: assert that nothing has been changed
25 ansible.builtin.assert:
26 that: not zbxtempgrp_existing is changed
27
28 - name: test - attempt to create new Zabbix template group matching name of default Zabbix template group
29 community.zabbix.zabbix_templategroup:
30 template_groups:
31 - Templates
32 state: present
33 register: zbxtempgrp_default_existing
34
35 - name: assert that nothing has been changed
36 ansible.builtin.assert:
37 that: not zbxtempgrp_default_existing is changed
38
39 - name: test - attempt to delete previously created zabbix template group
40 community.zabbix.zabbix_templategroup:
41 template_groups:
42 - zbxtempgrp_example_group01
43 state: absent
44 register: zbxtempgrp_existing_delete
45
46 - name: assert that group was deleted
47 ansible.builtin.assert:
48 that: zbxtempgrp_existing_delete is changed
49
50 - name: test - attempt to delete non-existing zabbix template group
51 community.zabbix.zabbix_templategroup:
52 template_groups:
53 - zbxtempgrp_example_group01
54 state: absent
55 register: zbxtempgrp_missing_delete
56
57 - name: assert that nothing has been changed
58 ansible.builtin.assert:
59 that: not zbxtempgrp_missing_delete is changed
60
61 - name: test - create template group with propagation
62 community.zabbix.zabbix_templategroup:
63 template_groups:
64 - zbxtmpgrp_example_group01
65 - zbxtmpgrp_example_group01/subgroup
66 propagate:
67 permissions: true
68 state: present
69 register: zbxtmpgrp_create
70
71 - name: assert that group was created
72 ansible.builtin.assert:
73 that: zbxtmpgrp_create is changed
74
75 - name: test - propagate without creation template group
76 community.zabbix.zabbix_templategroup:
77 template_groups:
78 - zbxtmpgrp_example_group01
79 - zbxtmpgrp_example_group01/subgroup
80 propagate:
81 permissions: true
82 state: present
83 register: zbxtmpgrp_propagate
84
85 - name: assert that group was propagated
86 ansible.builtin.assert:
87 that: zbxtmpgrp_propagate is changed
88
89 - name: test - delete template groups
90 community.zabbix.zabbix_templategroup:
91 template_groups:
92 - zbxtmpgrp_example_group01
93 - zbxtmpgrp_example_group01/subgroup
94 state: absent