Debian Codegraph @

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

raw
1 ---
2 - name: test - do not run tests with < Zabbix 7.0
3 meta: end_play
4 when: zabbix_version is version('7.0', '<')
5
6 - name: test - try to create a TOTP MFA method
7 community.zabbix.zabbix_mfa:
8 name: Zabbix TOTP
9 method_type: totp
10 hash_function: sha-1
11 code_length: 6
12 register: zbxmfa_create
13
14 - name: assert that the TOTP MFA method was created
15 ansible.builtin.assert:
16 that:
17 - zbxmfa_create.changed is sameas True
18
19 - name: test - try to update the TOTP MFA method (present)
20 community.zabbix.zabbix_mfa:
21 name: Zabbix TOTP
22 method_type: totp
23 hash_function: sha-1
24 code_length: 6
25 register: zbxmfa_update
26
27 - name: assert that the TOTP MFA method was NOT updated
28 ansible.builtin.assert:
29 that:
30 - zbxmfa_update.changed is sameas False
31
32 - name: test - try to delete TOTP MFA method
33 community.zabbix.zabbix_mfa:
34 name: Zabbix TOTP
35 state: absent
36 register: zbxmfa_delete
37
38 - name: assert that the TOTP MFA method was deleted
39 ansible.builtin.assert:
40 that:
41 - zbxmfa_delete.changed is sameas True
42 - zbxmfa_delete.msg == "Successfully deleted MFA method."
43
44 - name: test - try to create a Duo MFA method
45 community.zabbix.zabbix_mfa:
46 name: Duo authentication service prompt
47 method_type: duo_universal_prompt
48 api_hostname: api_hostname
49 clientid: clientid
50 client_secret: client_secret
51 register: zbxmfa_create
52
53 - name: assert that the Duo MFA method was created
54 ansible.builtin.assert:
55 that:
56 - zbxmfa_create.changed is sameas True
57
58 - name: test - try to update the Duo MFA method (present)
59 community.zabbix.zabbix_mfa:
60 name: Duo authentication service prompt
61 method_type: duo_universal_prompt
62 api_hostname: api_hostname
63 clientid: clientid
64 client_secret: client_secret
65 register: zbxmfa_update
66
67 - name: assert that the Duo MFA method was updated (without changes)
68 ansible.builtin.assert:
69 that:
70 - zbxmfa_update.changed is sameas True
71
72 - name: test - try to delete the Duo MFA methid
73 community.zabbix.zabbix_mfa:
74 name: Duo authentication service prompt
75 state: absent
76 register: zbxmfa_delete
77
78 - name: assert that the Duo MFA method was deleted
79 ansible.builtin.assert:
80 that:
81 - zbxmfa_delete.changed is sameas True
82 - zbxmfa_delete.msg == "Successfully deleted MFA method."