Skip to content

Commit

Permalink
Fix zabbix_authentication int tests for 6.0 server
Browse files Browse the repository at this point in the history
  • Loading branch information
CircuitCipher committed Sep 6, 2024
1 parent 5db04af commit e87c33b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
bugfixes:
- zabbix_authentication - fix inability to update passwd_check_rules
- zabbix_authentication - fix inability to set passwd_check_rules to empty list
4 changes: 2 additions & 2 deletions tests/integration/targets/setup_zabbix/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
status_code: 200
retries: 60
delay: 5
until: check_login_result is defined and 'json' in check_login_result and 'result' in check_login_result.json
register: check_login_result
until: check_login_under64_result is defined and 'json' in check_login_under64_result and 'result' in check_login_under64_result.json
register: check_login_under64_result
when: zabbix_version is version('6.4', '<')

- name: check login to zabbix for Zabbix >= 6.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
community.zabbix.zabbix_authentication:
passwd_check_rules: "avoid_easy_to_guess"

- name: Set the login result based on current zabbix version
set_fact:
login_result: "{{ check_login_under64_result if zabbix_version is version('6.4', '<') else check_login_result }}"

- name: Get the authentication rules
ansible.builtin.uri:
url: "{{ zabbix_api_server_url }}/api_jsonrpc.php"
Expand All @@ -12,12 +16,11 @@
method: "authentication.get"
params: {}
id: "1"
auth: "{{ check_login_result.json.result }}"
auth: "{{ login_result.json.result }}"
body_format: json
status_code: 200
register: get_auth_result


# Internally the value of 8 represents an "avoid_easy_to_guess" rule
- name: Assert that the passwd_check_rules is 8 (avoid_easy_to_guess)
ansible.builtin.assert:
Expand All @@ -37,12 +40,11 @@
method: "authentication.get"
params: {}
id: "1"
auth: "{{ check_login_result.json.result }}"
auth: "{{ login_result.json.result }}"
body_format: json
status_code: 200
register: get_auth_result


# Internally the value of 0 represents an empty password check rule set
- name: Assert that the passwd_check_rules is empty
ansible.builtin.assert:
Expand Down

0 comments on commit e87c33b

Please sign in to comment.