Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.0.0 Addendum #485

Merged
merged 14 commits into from
Dec 4, 2023
Merged
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Code of Conduct
The `checkmk.general` collection follows the Ansible project's
[Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html).
[Code of Conduct](https://docs.ansible.com/ansible/devel/community/code_of_conduct.html).
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Name | Description

Name | Description | Tests
--- | --- | ---
[checkmk.general.bakery](https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/lookup/bakery.py)|Look up the status pf the Checkmk agent bakery.|[![Integration Tests for bakery Lookup Module](https://github.com/Checkmk/ansible-collection-checkmk.general/actions/workflows/ans-int-test-lkp-bakery.yaml/badge.svg)](https://github.com/Checkmk/ansible-collection-checkmk.general/actions/workflows/ans-int-test-lkp-bakery.yaml)
[checkmk.general.folder](https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/lookup/folder.py)|Look up folder attributes.|[![Integration Tests for Folder Lookup Module](https://github.com/Checkmk/ansible-collection-checkmk.general/actions/workflows/ans-int-test-lkp-folder.yaml/badge.svg)](https://github.com/Checkmk/ansible-collection-checkmk.general/actions/workflows/ans-int-test-lkp-folder.yaml)
[checkmk.general.folders](https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/lookup/folders.py)|Look up all folders.|[![Integration Tests for Folders Lookup Module](https://github.com/Checkmk/ansible-collection-checkmk.general/actions/workflows/ans-int-test-lkp-folders.yaml/badge.svg)](https://github.com/Checkmk/ansible-collection-checkmk.general/actions/workflows/ans-int-test-lkp-folders.yaml)
[checkmk.general.host](https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/lookup/host.py)|Look up host attributes.|[![Integration Tests for Host Lookup Module](https://github.com/Checkmk/ansible-collection-checkmk.general/actions/workflows/ans-int-test-lkp-host.yaml/badge.svg)](https://github.com/Checkmk/ansible-collection-checkmk.general/actions/workflows/ans-int-test-lkp-host.yaml)
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ and we will do our best to fix it as soon as possible.
## Reporting a Vulnerability

For now, please open a normal [issue](https://github.com/Checkmk/ansible-collection-checkmk.general/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
in the repository but try to disclose the vulnerability as reasonable as possible.
in the repository but try to disclose the vulnerability as reasonable as possible.
2 changes: 1 addition & 1 deletion SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ Collection Version | Checkmk Versions | Ansible Versions | Remarks
3.2.0 | 2.0.0p38, 2.1.0p32, 2.2.0p8 | 2.13, 2.14, 2.15 | None
3.3.0 | 2.0.0p39, 2.1.0p35, 2.2.0p12 | 2.13, 2.14, 2.15 | None
3.4.0 | 2.0.0p39, 2.1.0p36, 2.2.0p14 | 2.13, 2.14, 2.15 | None
4.0.0 | 2.0.0p39, 2.1.0p36, 2.2.0p14 | 2.14, 2.15, 2.16 | Breaking changes to the following roles: `agent`, `server`.
4.0.0 | 2.0.0p39, 2.1.0p36, 2.2.0p16 | 2.14, 2.15, 2.16 | Breaking changes to the following roles: `agent`, `server`.
4 changes: 4 additions & 0 deletions changelogs/fragments/activation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
minor_changes:
- Activation module - Implement proper support for `redirect` parameter.
This means, the activation module can now optionally wait for a completed
activation or just trigger it and move on.
3 changes: 3 additions & 0 deletions changelogs/fragments/discovery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
minor_changes:
- Discovery module - Print error message, when using state "tabula_rasa"
in bulk discovery mode, because that state is not supported by the API.
5 changes: 5 additions & 0 deletions changelogs/fragments/lookups.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
major_changes:
- Bakery lookup plugin - Get the status of the Checkmk Agent Bakery.

minor_changes:
- Lookup API - Add improved error handling.
2 changes: 1 addition & 1 deletion playbooks/demo/lookup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
delegate_to: localhost
run_once: true # noqa run-once[task]

## TODO: @lgetwan: Please take a look at these tasks and fix them. Bonus: Add the new lookup modules. :)
## TODO: @lgetwan: Please take a look at these tasks and fix them. Bonus: Add the new lookup modules. :)

# - name: "Get all hosts of the folder /test recursively"
# ansible.builtin.debug:
Expand Down
11 changes: 11 additions & 0 deletions plugins/modules/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,17 @@ def run_module():
)
module.fail_json(**result_as_dict(result))

if not single_mode and module.params.get("state") == "tabula_rasa":
result = RESULT(
http_code=0,
msg="State 'tabula_rasa' does not exist in bulk_discovery, please use refresh!",
content="",
etag="",
failed=True,
changed=False,
)
module.fail_json(**result_as_dict(result))

result = wait_for_completion(single_mode, servicecompletion)

result = discovery.post()
Expand Down
2 changes: 1 addition & 1 deletion roles/agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It can be installed as easy as running:

## Role Variables

checkmk_agent_version: "2.2.0p14"
checkmk_agent_version: "2.2.0p16"

The Checkmk version of the site your agents will talk to.

Expand Down
2 changes: 1 addition & 1 deletion roles/agent/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
checkmk_agent_version: "2.2.0p14"
checkmk_agent_version: "2.2.0p16"
checkmk_agent_edition: cre
checkmk_agent_server_protocol: http
checkmk_agent_server: localhost
Expand Down
2 changes: 1 addition & 1 deletion roles/agent/molecule/2.2.0/group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# General
checkmk_var_version: "2.2.0p14"
checkmk_var_version: "2.2.0p16"
checkmk_var_edition: "cre"
checkmk_var_checkmk_site: "my_site"
checkmk_var_automation_user: "cmkadmin"
Expand Down
2 changes: 1 addition & 1 deletion roles/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To learn about the distributions used in automated tests, inspect the correspond

## Role Variables

checkmk_server_version: "2.2.0p14"
checkmk_server_version: "2.2.0p16"

The global Checkmk version. This is used for installing Checkmk.
To manage sites and their version, see `checkmk_server_sites`.
Expand Down
3 changes: 2 additions & 1 deletion roles/server/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ checkmk_server_server_stable_os:
- Ubuntu-20
- Ubuntu-22

checkmk_server_version: "2.2.0p14"
checkmk_server_version: "2.2.0p16"
checkmk_server_edition: cre
checkmk_server_verify_setup: 'true'

Expand All @@ -43,6 +43,7 @@ checkmk_server_sites: []
# value: "on"
# - var: LIVESTATUS_TCP_PORT
# value: "6557"

checkmk_server_configure_firewall: 'true'

checkmk_server_backup_on_update: 'true' # Not recommended to disable this option
Expand Down
22 changes: 15 additions & 7 deletions roles/server/molecule/2.0.0/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
# General
checkmk_var_version: "2.0.0p39"
checkmk_var_edition: "cre"
checkmk_server_verify_setup: 'true'
checkmk_var_server_url: "http://127.0.0.1/"
checkmk_var_automation_user: "cmkadmin"
checkmk_var_automation_secret: "d7589df1"

# Server Role
checkmk_server_edition: "{{ checkmk_var_edition }}"
checkmk_server_version: "{{ checkmk_var_version }}"
checkmk_server_verify_setup: 'true'

checkmk_server_configure_firewall: 'false'

checkmk_server_backup_on_update: 'true' # Not recommended to disable this option
checkmk_server_backup_dir: /tmp
checkmk_server_backup_opts: '--no-past'
checkmk_server_allow_downgrades: 'true'
checkmk_server_download_user: []
checkmk_server_download_pass: []

checkmk_server_sites:
- name: "started"
Expand Down Expand Up @@ -67,3 +63,15 @@ checkmk_server_sites:
state: absent
admin_pw: "{{ checkmk_var_automation_secret }}"
update_conflict_resolution: install

checkmk_server_configure_firewall: 'true'

checkmk_server_backup_on_update: 'true' # Not recommended to disable this option
checkmk_server_backup_dir: /tmp
checkmk_server_backup_opts: '--no-past'
checkmk_server_allow_downgrades: 'false'

checkmk_server_epel_gpg_check: 'true'

checkmk_server_cleanup: 'false'
checkmk_server_no_log: 'false'
22 changes: 15 additions & 7 deletions roles/server/molecule/2.1.0/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
# General
checkmk_var_version: "2.1.0p36"
checkmk_var_edition: "cre"
checkmk_server_verify_setup: 'true'
checkmk_var_server_url: "http://127.0.0.1/"
checkmk_var_automation_user: "cmkadmin"
checkmk_var_automation_secret: "d7589df1"

# Server Role
checkmk_server_edition: "{{ checkmk_var_edition }}"
checkmk_server_version: "{{ checkmk_var_version }}"
checkmk_server_verify_setup: 'true'

checkmk_server_configure_firewall: 'false'

checkmk_server_backup_on_update: 'true' # Not recommended to disable this option
checkmk_server_backup_dir: /tmp
checkmk_server_backup_opts: '--no-past'
checkmk_server_allow_downgrades: 'true'
checkmk_server_download_user: []
checkmk_server_download_pass: []

checkmk_server_sites:
- name: "started"
Expand Down Expand Up @@ -67,3 +63,15 @@ checkmk_server_sites:
state: absent
admin_pw: "{{ checkmk_var_automation_secret }}"
update_conflict_resolution: install

checkmk_server_configure_firewall: 'true'

checkmk_server_backup_on_update: 'true' # Not recommended to disable this option
checkmk_server_backup_dir: /tmp
checkmk_server_backup_opts: '--no-past'
checkmk_server_allow_downgrades: 'false'

checkmk_server_epel_gpg_check: 'true'

checkmk_server_cleanup: 'false'
checkmk_server_no_log: 'false'
24 changes: 16 additions & 8 deletions roles/server/molecule/2.2.0/group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
---
# General
checkmk_var_version: "2.2.0p14"
checkmk_var_version: "2.2.0p16"
checkmk_var_edition: "cre"
checkmk_server_verify_setup: 'true'
checkmk_var_server_url: "http://127.0.0.1/"
checkmk_var_automation_user: "cmkadmin"
checkmk_var_automation_secret: "d7589df1"

# Server Role
checkmk_server_edition: "{{ checkmk_var_edition }}"
checkmk_server_version: "{{ checkmk_var_version }}"
checkmk_server_verify_setup: 'true'

checkmk_server_configure_firewall: 'false'

checkmk_server_backup_on_update: 'true' # Not recommended to disable this option
checkmk_server_backup_dir: /tmp
checkmk_server_backup_opts: '--no-past'
checkmk_server_allow_downgrades: 'true'
checkmk_server_download_user: []
checkmk_server_download_pass: []

checkmk_server_sites:
- name: "started"
Expand Down Expand Up @@ -67,3 +63,15 @@ checkmk_server_sites:
state: absent
admin_pw: "{{ checkmk_var_automation_secret }}"
update_conflict_resolution: install

checkmk_server_configure_firewall: 'true'

checkmk_server_backup_on_update: 'true' # Not recommended to disable this option
checkmk_server_backup_dir: /tmp
checkmk_server_backup_opts: '--no-past'
checkmk_server_allow_downgrades: 'false'

checkmk_server_epel_gpg_check: 'true'

checkmk_server_cleanup: 'false'
checkmk_server_no_log: 'false'
4 changes: 2 additions & 2 deletions roles/server/tasks/sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
omd config {{ item.name }} AUTOSTART on
args:
executable: /bin/bash
no_log: true
no_log: "{{ checkmk_server_no_log | bool }}"
loop: "{{ checkmk_server_sites }}"
when: (item.state == "enabled") or (item.state == "started")
register: checkmk_server_sites_stopped
Expand Down Expand Up @@ -87,7 +87,7 @@
omd config {{ item.name }} AUTOSTART off
args:
executable: /bin/bash
no_log: true
no_log: "{{ checkmk_server_no_log | bool }}"
loop: "{{ checkmk_server_sites }}"
when: (item.state == "disabled") or (item.state == "present") or (item.state == "stopped")
register: checkmk_server_sites_stopped
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ collection_dir="${script_dir%/*}"
# Update these as necessary:
checkmk_ancient="2.0.0p39"
checkmk_oldstable="2.1.0p36"
checkmk_stable="2.2.0p14"
checkmk_stable="2.2.0p16"

while getopts 's:t:' OPTION; do
case "$OPTION" in
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/targets/activation/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
test_sites:
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cre"
site: "stable_raw"
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cee"
site: "stable_ent"
- version: "2.1.0p36"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/bakery/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
test_sites:
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cee"
site: "stable_ent"
- version: "2.1.0p36"
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/targets/contact_group/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
test_sites:
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cre"
site: "stable_raw"
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cee"
site: "stable_ent"
- version: "2.1.0p36"
Expand Down
14 changes: 1 addition & 13 deletions tests/integration/targets/discovery/tasks/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
run_once: true # noqa run-once[task]
loop: "{{ checkmk_hosts }}"

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Bulk: Rescan services."
- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Bulk: Refresh (tabula_rasa) services."
discovery:
server_url: "{{ checkmk_var_server_url }}"
site: "{{ outer_item.site }}"
Expand Down Expand Up @@ -189,18 +189,6 @@
bulk_size: 5
delegate_to: localhost

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Bulk: Tabula Rasa. (Only 2.2)."
discovery:
server_url: "{{ checkmk_var_server_url }}"
site: "{{ outer_item.site }}"
automation_user: "{{ checkmk_var_automation_user }}"
automation_secret: "{{ checkmk_var_automation_secret }}"
hosts: "{{ checkmk_host_names }}"
state: "tabula_rasa"
bulk_size: 5
delegate_to: localhost
when: "'2.2' in outer_item.version"

- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Bulk: Discover hosts (fix_all)."
discovery:
server_url: "{{ checkmk_var_server_url }}"
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/targets/discovery/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
test_sites:
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cre"
site: "stable_raw"
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cee"
site: "stable_ent"
- version: "2.1.0p36"
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/targets/downtime/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
test_sites:
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cre"
site: "stable_raw"
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cee"
site: "stable_ent"
- version: "2.1.0p36"
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/targets/folder/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
test_sites:
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cre"
site: "stable_raw"
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cee"
site: "stable_ent"
- version: "2.1.0p36"
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/targets/host/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
test_sites:
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cre"
site: "stable_raw"
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cee"
site: "stable_ent"
- version: "2.1.0p36"
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/targets/host_group/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
test_sites:
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cme"
site: "stable_cme"
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cre"
site: "stable_raw"
- version: "2.2.0p14"
- version: "2.2.0p16"
edition: "cee"
site: "stable_ent"
- version: "2.1.0p36"
Expand Down
Loading
Loading