-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zabbix_authentication - fix inability to update passwd_check_rules (#…
- Loading branch information
1 parent
e48220d
commit 5ad5046
Showing
5 changed files
with
64 additions
and
8 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
changelogs/fragments/fix-zabbix-authentication-passwd-check-rules.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bugfixes: | ||
- zabbix_authentication - fix inability to update passwd_check_rules | ||
- zabbix_authentication - fix inability to set passwd_check_rules to empty list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/integration/targets/test_zabbix_authentication/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...argets/test_zabbix_authentication/tasks/zabbix_authentication_test_passwd_check_rules.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
- name: Start with a known state with one rule enabled | ||
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" | ||
method: POST | ||
body: | ||
jsonrpc: "2.0" | ||
method: "authentication.get" | ||
params: {} | ||
id: "1" | ||
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: | ||
that: | ||
- get_auth_result.json.result.passwd_check_rules == "8" | ||
|
||
- name: Disable all password check rules | ||
community.zabbix.zabbix_authentication: | ||
passwd_check_rules: [] | ||
|
||
- name: Get the authentication rules | ||
ansible.builtin.uri: | ||
url: "{{ zabbix_api_server_url }}/api_jsonrpc.php" | ||
method: POST | ||
body: | ||
jsonrpc: "2.0" | ||
method: "authentication.get" | ||
params: {} | ||
id: "1" | ||
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: | ||
that: | ||
- get_auth_result.json.result.passwd_check_rules == "0" |