Skip to content

Commit ed00484

Browse files
Merge pull request #199 from tribe29/feature-new-pass-hashing
Add support for new password hashing algorithm to agent role
2 parents 7b6edde + 11c0c7e commit ed00484

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to
2+
3+
minor_changes:
4+
- Agent role - Now supports new password hashing according to L(Werk 14391,https://checkmk.com/werk/14391)
5+
6+
## Line Format
7+
8+
# When writing a changelog entry, use the following format:
9+
10+
# - scope - description starting with a uppercase letter and ending with a period at the very end. Multiple sentences are allowed.
11+
12+
# The scope is usually a module or plugin name or group of modules or plugins, for example, lookup plugins. While module names can (and should) be mentioned directly (foo_module), plugin names should always be followed by the type (foo inventory plugin).
13+
14+
# For changes that are not really scoped (for example, which affect a whole collection), use the following format:
15+
16+
# - Description starting with an uppercase letter and ending with a dot at the very end. Multiple sentences are allowed.
17+
18+
19+
## Possible keys:
20+
21+
# breaking_changes
22+
23+
# Changes that break existing playbooks or roles. This includes any change to existing behavior that forces users to update tasks. Displayed in both the changelogs and the Porting Guides.
24+
# major_changes
25+
26+
# Major changes to Ansible itself. Generally does not include module or plugin changes. Displayed in both the changelogs and the Porting Guides.
27+
# minor_changes
28+
29+
# Minor changes to Ansible, modules, or plugins. This includes new features, new parameters added to modules, or behavior changes to existing parameters.
30+
# deprecated_features
31+
32+
# Features that have been deprecated and are scheduled for removal in a future release. Displayed in both the changelogs and the Porting Guides.
33+
# removed_features
34+
35+
# Features that were previously deprecated and are now removed. Displayed in both the changelogs and the Porting Guides.
36+
# security_fixes
37+
38+
# Fixes that address CVEs or resolve security concerns. Include links to CVE information.
39+
# bugfixes
40+
41+
# Fixes that resolve issues.
42+
# known_issues
43+
44+
# Known issues that are currently not fixed or will not be fixed.

roles/server/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ checkmk_server_server_stable_os:
1111
- RedHat-8
1212

1313
checkmk_server_edition: cre
14-
checkmk_server_version: 2.1.0p13
14+
checkmk_server_version: 2.1.0p17
1515
checkmk_server_verify_setup: 'true'
1616

1717
checkmk_server_download_user: []

roles/server/tasks/sites.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
tags:
8282
- destroy-sites
8383

84-
- name: "Update Site Admin Password."
84+
- name: "Update Site Admin Password for Checkmk < 2.1."
8585
become: true
8686
ansible.builtin.shell: |
8787
set -o pipefail
@@ -90,6 +90,21 @@
9090
executable: /bin/bash
9191
no_log: true
9292
loop: "{{ checkmk_server_sites }}"
93-
when: item.state != "absent"
93+
when: (item.state != "absent") and (item.version | regex_replace('p.*', '') is version('2.1', '<'))
94+
tags:
95+
- set-site-admin-pw
96+
97+
# In the future this should be done with 'cmk-passwd' available from 2.1.0p16 (https://checkmk.com/werk/14389)
98+
# To keep things simple, we do it in a more generic way here, which works in all 2.1 releases
99+
- name: "Update Site Admin Password for Checkmk >= 2.1."
100+
become: true
101+
ansible.builtin.shell: |
102+
set -o pipefail
103+
echo '{{ item.admin_pw }}' | htpasswd -i -B -C 12 /omd/sites/{{ item.name }}/etc/htpasswd cmkadmin
104+
args:
105+
executable: /bin/bash
106+
no_log: true
107+
loop: "{{ checkmk_server_sites }}"
108+
when: (item.state != "absent") and (item.version | regex_replace('p.*', '') is version('2.1', '>='))
94109
tags:
95110
- set-site-admin-pw

0 commit comments

Comments
 (0)