`, the foll
Authors
~~~~~~~
+- Lars Getwan (@lgetwan)
- diademiemi (@diademiemi)
- Geoffroy Stévenne (@geof77)
+- Michael Sekania (@msekania)
diff --git a/docs/rules_lookup.rst b/docs/rules_lookup.rst
index c02bd3a0c..b51e7300b 100644
--- a/docs/rules_lookup.rst
+++ b/docs/rules_lookup.rst
@@ -7,7 +7,7 @@
:trim:
.. meta::
- :antsibull-docs: 2.10.0
+ :antsibull-docs: 2.11.0
.. Anchors
@@ -23,7 +23,7 @@ checkmk.general.rules lookup -- Get a list rules
.. Collection note
.. note::
- This lookup plugin is part of the `checkmk.general collection `_ (version 4.4.1).
+ This lookup plugin is part of the `checkmk.general collection `_ (version 5.0.0).
It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.
@@ -220,7 +220,7 @@ examples: ``lookup('checkmk.general.rules', key1=value1, key2=value2, ...)`` and
- A regex to filter for certain comment stings.
+ A regex to filter for certain comment strings.
.. rst-class:: ansible-option-line
@@ -264,6 +264,47 @@ examples: ``lookup('checkmk.general.rules', key1=value1, key2=value2, ...)`` and
A regex to filter for certain descriptions.
+ .. rst-class:: ansible-option-line
+
+ :ansible-option-default-bold:`Default:` :ansible-option-default:`""`
+
+ .. raw:: html
+
+
+
+ * - .. raw:: html
+
+
+
+
+ .. _ansible_collections.checkmk.general.rules_lookup__parameter-folder_regex:
+
+ .. rst-class:: ansible-option-title
+
+ **folder_regex**
+
+ .. raw:: html
+
+
+
+ .. ansible-option-type-line::
+
+ :ansible-option-type:`string`
+
+
+
+
+ .. raw:: html
+
+
+
+ - .. raw:: html
+
+
+
+ A regex to filter for certain folders.
+
+
.. rst-class:: ansible-option-line
:ansible-option-default-bold:`Default:` :ansible-option-default:`""`
@@ -521,6 +562,23 @@ Examples
loop_control:
label: "{{ item.id }}"
+ - name: Get all rules of the ruleset host_groups in folder /test
+ ansible.builtin.debug:
+ msg: "Rule: {{ item.extensions }}"
+ loop: "{{
+ lookup('checkmk.general.rules',
+ ruleset='host_groups',
+ regex_folder='^/test$',
+ server_url=server_url,
+ site=site,
+ automation_user=automation_user,
+ automation_secret=automation_secret,
+ validate_certs=False
+ )
+ }}"
+ loop_control:
+ label: "{{ item.id }}"
+
- name: actice_checks:http rules that match a certain description AND comment
ansible.builtin.debug:
msg: "Rule: {{ item.extensions }}"
@@ -543,10 +601,10 @@ Examples
ansible.builtin.debug:
msg: "Rule: {{ item.extensions }}"
vars:
- ansible_lookup_checkmk_server_url: "http://my_server/"
- ansible_lookup_checkmk_site: "my_site"
- ansible_lookup_checkmk_automation_user: "my_user"
- ansible_lookup_checkmk_automation_secret: "my_secret"
+ ansible_lookup_checkmk_server_url: "http://myserver/"
+ ansible_lookup_checkmk_site: "mysite"
+ ansible_lookup_checkmk_automation_user: "myuser"
+ ansible_lookup_checkmk_automation_secret: "mysecret"
ansible_lookup_checkmk_validate_certs: false
loop: "{{
lookup('checkmk.general.rules', ruleset='host_groups') }}"
diff --git a/docs/ruleset_lookup.rst b/docs/ruleset_lookup.rst
index f38a6c287..ef670b0cc 100644
--- a/docs/ruleset_lookup.rst
+++ b/docs/ruleset_lookup.rst
@@ -7,7 +7,7 @@
:trim:
.. meta::
- :antsibull-docs: 2.10.0
+ :antsibull-docs: 2.11.0
.. Anchors
@@ -23,7 +23,7 @@ checkmk.general.ruleset lookup -- Show a ruleset
.. Collection note
.. note::
- This lookup plugin is part of the `checkmk.general collection `_ (version 4.4.1).
+ This lookup plugin is part of the `checkmk.general collection `_ (version 5.0.0).
It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.
@@ -442,10 +442,10 @@ Examples
ansible.builtin.debug:
msg: "Ruleset: {{ extensions }}"
vars:
- ansible_lookup_checkmk_server_url: "http://my_server/"
- ansible_lookup_checkmk_site: "my_site"
- ansible_lookup_checkmk_automation_user: "my_user"
- ansible_lookup_checkmk_automation_secret: "my_secret"
+ ansible_lookup_checkmk_server_url: "http://myserver/"
+ ansible_lookup_checkmk_site: "mysite"
+ ansible_lookup_checkmk_automation_user: "myuser"
+ ansible_lookup_checkmk_automation_secret: "mysecret"
ansible_lookup_checkmk_validate_certs: false
extensions: "{{ lookup('checkmk.general.ruleset', ruleset='host_groups') }}"
diff --git a/docs/rulesets_lookup.rst b/docs/rulesets_lookup.rst
index 75fceb231..1629b089f 100644
--- a/docs/rulesets_lookup.rst
+++ b/docs/rulesets_lookup.rst
@@ -7,7 +7,7 @@
:trim:
.. meta::
- :antsibull-docs: 2.10.0
+ :antsibull-docs: 2.11.0
.. Anchors
@@ -23,7 +23,7 @@ checkmk.general.rulesets lookup -- Search rulesets
.. Collection note
.. note::
- This lookup plugin is part of the `checkmk.general collection `_ (version 4.4.1).
+ This lookup plugin is part of the `checkmk.general collection `_ (version 5.0.0).
It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.
@@ -595,10 +595,10 @@ Examples
ansible.builtin.debug:
msg: "Ruleset {{ item.extension.name }} is deprecated."
vars:
- ansible_lookup_checkmk_server_url: "http://my_server/"
- ansible_lookup_checkmk_site: "my_site"
- ansible_lookup_checkmk_automation_user: "my_user"
- ansible_lookup_checkmk_automation_secret: "my_secret"
+ ansible_lookup_checkmk_server_url: "http://myserver/"
+ ansible_lookup_checkmk_site: "mysite"
+ ansible_lookup_checkmk_automation_user: "myuser"
+ ansible_lookup_checkmk_automation_secret: "mysecret"
ansible_lookup_checkmk_validate_certs: false
loop: "{{
lookup('checkmk.general.rulesets', regex='', rulesets_deprecated=True, rulesets_used=True) }}"
diff --git a/docs/service_group_module.rst b/docs/service_group_module.rst
index beeff8dac..6ccabee34 100644
--- a/docs/service_group_module.rst
+++ b/docs/service_group_module.rst
@@ -7,7 +7,7 @@
:trim:
.. meta::
- :antsibull-docs: 2.10.0
+ :antsibull-docs: 2.11.0
.. Anchors
@@ -23,7 +23,7 @@ checkmk.general.service_group module -- Manage service groups in Checkmk (bulk v
.. Collection note
.. note::
- This module is part of the `checkmk.general collection `_ (version 4.4.1).
+ This module is part of the `checkmk.general collection `_ (version 5.0.0).
It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.
@@ -460,10 +460,10 @@ Examples
# Create a single service group.
- name: "Create a single service group."
checkmk.general.service_group:
- server_url: "http://my_server/"
- site: "my_site"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ server_url: "http://myserver/"
+ site: "mysite"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: "my_service_group"
title: "My Service Group"
customer: "provider"
@@ -472,10 +472,10 @@ Examples
# Create several service groups.
- name: "Create several service groups."
checkmk.general.service_group:
- server_url: "http://my_server/"
- site: "my_site"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ server_url: "http://myserver/"
+ site: "mysite"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
customer: "provider"
groups:
- name: "my_service_group_one"
@@ -489,10 +489,10 @@ Examples
# Create several service groups.
- name: "Create several service groups."
checkmk.general.service_group:
- server_url: "http://my_server/"
- site: "my_site"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ server_url: "http://myserver/"
+ site: "mysite"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
customer: "provider"
groups:
- name: "my_service_group_one"
@@ -504,20 +504,20 @@ Examples
# Delete a single service group.
- name: "Create a single service group."
checkmk.general.service_group:
- server_url: "http://my_server/"
- site: "my_site"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ server_url: "http://myserver/"
+ site: "mysite"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: "my_service_group"
state: "absent"
# Delete several service groups.
- name: "Delete several service groups."
checkmk.general.service_group:
- server_url: "http://my_server/"
- site: "my_site"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ server_url: "http://myserver/"
+ site: "mysite"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
groups:
- name: "my_service_group_one"
- name: "my_service_group_two"
diff --git a/docs/tag_group_module.rst b/docs/tag_group_module.rst
index 7787df47e..1c684d86b 100644
--- a/docs/tag_group_module.rst
+++ b/docs/tag_group_module.rst
@@ -7,7 +7,7 @@
:trim:
.. meta::
- :antsibull-docs: 2.10.0
+ :antsibull-docs: 2.11.0
.. Anchors
@@ -23,7 +23,7 @@ checkmk.general.tag_group module -- Manage tag groups in Checkmk.
.. Collection note
.. note::
- This module is part of the `checkmk.general collection `_ (version 4.4.1).
+ This module is part of the `checkmk.general collection `_ (version 5.0.0).
It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.
@@ -645,10 +645,10 @@ Examples
# Create a tag group
- name: "Create tag group"
checkmk.general.tag_group:
- server_url: "https://my_server/"
- site: "my_site"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ server_url: "https://myserver/"
+ site: "mysite"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: datacenter
title: Datacenter
topic: Tags
@@ -667,10 +667,10 @@ Examples
# Delete a tag group
- name: "Delete tag group."
checkmk.general.tag_group:
- server_url: "https://my_server/"
- site: "my_site"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ server_url: "https://myserver/"
+ site: "mysite"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: datacenter
state: "absent"
diff --git a/docs/timeperiod_module.rst b/docs/timeperiod_module.rst
index 91d42024a..2ca50588e 100644
--- a/docs/timeperiod_module.rst
+++ b/docs/timeperiod_module.rst
@@ -7,7 +7,7 @@
:trim:
.. meta::
- :antsibull-docs: 2.10.0
+ :antsibull-docs: 2.11.0
.. Anchors
@@ -23,7 +23,7 @@ checkmk.general.timeperiod module -- Manage time periods in checkmk.
.. Collection note
.. note::
- This module is part of the `checkmk.general collection `_ (version 4.4.1).
+ This module is part of the `checkmk.general collection `_ (version 5.0.0).
It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.
@@ -490,10 +490,10 @@ Examples
# Creating and Updating is the same.
- name: "Create a new time period. (Attributes in one line)"
checkmk.general.timeperiod:
- server_url: "http://my_server/"
- site: "my_site"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ server_url: "http://myserver/"
+ site: "mysite"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: "worktime"
alias: "Worktime"
active_time_ranges: '[{"day": "all", "time_ranges": [{"start": "09:00:00", "end": "17:00:00"}]}]'
@@ -503,10 +503,10 @@ Examples
- name: "Create a new time period. (Attributes in multiple lines)"
checkmk.general.timeperiod:
- server_url: "http://my_server/"
- site: "my_site"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ server_url: "http://myserver/"
+ site: "mysite"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: "worktime"
alias: "Worktime"
active_time_ranges: [
@@ -538,10 +538,10 @@ Examples
- name: "Delete a time period."
checkmk.general.timeperiod:
- server_url: "http://my_server/"
- site: "my_site"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ server_url: "http://myserver/"
+ site: "mysite"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: "worktime"
state: "absent"
diff --git a/docs/user_module.rst b/docs/user_module.rst
index 5a4116307..2f3ca9fe2 100644
--- a/docs/user_module.rst
+++ b/docs/user_module.rst
@@ -7,7 +7,7 @@
:trim:
.. meta::
- :antsibull-docs: 2.10.0
+ :antsibull-docs: 2.11.0
.. Anchors
@@ -23,7 +23,7 @@ checkmk.general.user module -- Manage users in Checkmk.
.. Collection note
.. note::
- This module is part of the `checkmk.general collection `_ (version 4.4.1).
+ This module is part of the `checkmk.general collection `_ (version 5.0.0).
It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.
@@ -1208,10 +1208,10 @@ Examples
# Create a user.
- name: "Create a user."
checkmk.general.user:
- server_url: "http://my_server/"
+ server_url: "http://myserver/"
site: "local"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: "krichards"
fullname: "Keith Richards"
email: "keith.richards@rollingstones.com"
@@ -1225,10 +1225,10 @@ Examples
# Create an automation user.
- name: "Create an automation user."
checkmk.general.user:
- server_url: "http://my_server/"
+ server_url: "http://myserver/"
site: "local"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: "registration"
fullname: "Registration User"
auth_type: "automation"
@@ -1240,10 +1240,10 @@ Examples
# Create a user with the Checkmk Managed Edition (CME), using the `customer` parameter.
- name: "Create a user."
checkmk.general.user:
- server_url: "http://my_server/"
+ server_url: "http://myserver/"
site: "local"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: "krichards"
fullname: "Keith Richards"
email: "keith.richards@rollingstones.com"
@@ -1258,10 +1258,10 @@ Examples
# Create a detailed user.
- name: "Create a more complex user."
checkmk.general.user:
- server_url: "http://my_server/"
+ server_url: "http://myserver/"
site: "local"
- automation_user: "my_user"
- automation_secret: "my_secret"
+ automation_user: "myuser"
+ automation_secret: "mysecret"
name: "horst"
fullname: "Horst Schlämmer"
customer: "provider"
@@ -1281,7 +1281,7 @@ Examples
roles:
- "user"
authorized_sites:
- - "{{ my_site }}"
+ - "{{ mysite }}"
interface_theme: "dark"
sidebar_position: "right"
navigation_bar_icons: "show"
diff --git a/docs/version_lookup.rst b/docs/version_lookup.rst
index a09fed791..a4f3cdb49 100644
--- a/docs/version_lookup.rst
+++ b/docs/version_lookup.rst
@@ -7,7 +7,7 @@
:trim:
.. meta::
- :antsibull-docs: 2.10.0
+ :antsibull-docs: 2.11.0
.. Anchors
@@ -23,7 +23,7 @@ checkmk.general.version lookup -- Get the version of a Checkmk server
.. Collection note
.. note::
- This lookup plugin is part of the `checkmk.general collection `_ (version 4.4.1).
+ This lookup plugin is part of the `checkmk.general collection `_ (version 5.0.0).
It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.
@@ -392,20 +392,20 @@ Examples
vars:
version: "{{ lookup('checkmk.general.version',
server_url=my_url,
- site=my_site,
+ site=mysite,
validate_certs=False,
- automation_user=my_user,
- automation_secret=my_secret
+ automation_user=myuser,
+ automation_secret=mysecret
)}}"
- name: "Use variables outside the module call."
ansible.builtin.debug:
msg: "Server version is {{ version }}"
vars:
- ansible_lookup_checkmk_server_url: "http://my_server/"
- ansible_lookup_checkmk_site: "my_site"
- ansible_lookup_checkmk_automation_user: "my_user"
- ansible_lookup_checkmk_automation_secret: "my_secret"
+ ansible_lookup_checkmk_server_url: "http://myserver/"
+ ansible_lookup_checkmk_site: "mysite"
+ ansible_lookup_checkmk_automation_user: "myuser"
+ ansible_lookup_checkmk_automation_secret: "mysecret"
ansible_lookup_checkmk_validate_certs: false
attributes: "{{ lookup('checkmk.general.version') }}"
diff --git a/plugins/lookup/folder.py b/plugins/lookup/folder.py
index 0cf53d4e6..e4e058bb8 100644
--- a/plugins/lookup/folder.py
+++ b/plugins/lookup/folder.py
@@ -88,24 +88,23 @@
"""
EXAMPLES = """
-- name: Get the attributes of folder /tests
+- name: Get the attributes of folders /tests and /snmp
ansible.builtin.debug:
- msg: "Attributes of folder /network: {{ attributes }}"
- vars:
- attributes: "{{
- lookup('checkmk.general.folder',
- '~tests',
- server_url=my_server_url,
- site=mysite,
- automation_user=myuser,
- automation_secret=mysecret,
- validate_certs=False
- )
- }}"
+ msg: "Extended attributes of folder /network: {{ attributes.extensions }}"
+ loop: "{{
+ lookup('checkmk.general.folder',
+ '~tests', '~snmp',
+ server_url=my_server_url,
+ site=mysite,
+ automation_user=myuser,
+ automation_secret=mysecret,
+ validate_certs=False
+ )
+ }}"
- name: "Use variables outside the module call."
ansible.builtin.debug:
- msg: "Attributes of folder /network: {{ attributes }}"
+ msg: "Extended attributes of folder /network: {{ attributes.extensions }}"
vars:
ansible_lookup_checkmk_server_url: "http://myserver/"
ansible_lookup_checkmk_site: "mysite"
@@ -118,7 +117,8 @@
RETURN = """
_list:
description:
- - A list of dicts of attributes of the folder(s)
+ - A dict of attributes of the folder if you query a single folder
+ - A list of dicts of attributes of the folders if you query multiple folders
type: list
elements: str
"""
diff --git a/plugins/module_utils/api.py b/plugins/module_utils/api.py
index a16f3c69d..bdb01927b 100644
--- a/plugins/module_utils/api.py
+++ b/plugins/module_utils/api.py
@@ -44,7 +44,7 @@ def __init__(self, module):
# may be "present", "abesent" or an individual one
self.state = ""
- def _fetch(self, code_mapping, endpoint="", data=None, method="GET"):
+ def _fetch(self, code_mapping="", endpoint="", data=None, method="GET"):
http_mapping = GENERIC_HTTP_CODES.copy()
http_mapping.update(code_mapping)
diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py
index bbdf05a88..5412e3df8 100644
--- a/plugins/module_utils/utils.py
+++ b/plugins/module_utils/utils.py
@@ -20,12 +20,20 @@ def result_as_dict(result):
GENERIC_HTTP_CODES = {
- 204: (True, False, "Successfully executed"),
+ 200: (True, False, "OK: The operation was done successfully"),
+ 204: (True, False, "Operation done successfully. No further output."),
400: (False, True, "Bad request: Parameter or validation failure"),
+ 401: (False, True, "The user is not authorized to do this request"),
403: (False, True, "Forbidden: Configuration via Setup is disabled"),
- 404: (False, True, "Not found"),
- 406: (False, True, "Required headers are not satisfied"),
- 412: (False, True, "If-Match does not match ETag"),
- 415: (False, True, "Wrong content-type in header"),
- 428: (False, True, "If-Match header is missing"),
+ 404: (False, True, "Not Found: The requested object has not been found"),
+ 405: (
+ False,
+ True,
+ "This request is only allowed with other HTTP methods",
+ ),
+ 406: (False, True, "The requests accept headers can not be satisfied"),
+ 412: (False, True, "If-Match header doesn't match the object's ETag"),
+ 415: (False, True, "The submitted content-type is not supported"),
+ 428: (False, True, "The required If-Match header is missing"),
+ 500: (False, True, "General Server Error"),
}
diff --git a/plugins/modules/bakery.py b/plugins/modules/bakery.py
index 964d73bd6..32eaff7d2 100644
--- a/plugins/modules/bakery.py
+++ b/plugins/modules/bakery.py
@@ -95,29 +95,6 @@
result_as_dict,
)
-HTTP_CODES = {
- # http_code: (changed, failed, "Message")
- 200: (True, False, "The operation was done successfully."),
- 204: (
- True,
- False,
- "No Content: Operation done successfully. No further output.",
- ),
- 400: (False, True, "Bad Request: Parameter or validation failure."),
- 403: (False, True, "Forbidden: Configuration via WATO is disabled."),
- 406: (
- False,
- True,
- "Not Acceptable: The requests accept headers can not be satisfied.",
- ),
- 415: (
- False,
- True,
- "Unsupported Media Type: The submitted content-type is not supported.",
- ),
- 500: (False, True, "General Server Error."),
-}
-
class BakeryAPI(CheckmkAPI):
def post(self):
@@ -137,7 +114,6 @@ def post(self):
action = "bake_and_sign"
return self._fetch(
- code_mapping=HTTP_CODES,
endpoint="/domain-types/agent/actions/%s/invoke" % action,
data=data,
method="POST",
diff --git a/plugins/modules/discovery.py b/plugins/modules/discovery.py
index ee4bc3adf..92603365d 100644
--- a/plugins/modules/discovery.py
+++ b/plugins/modules/discovery.py
@@ -40,7 +40,7 @@
description: The action to perform during discovery.
type: str
default: new
- choices: [new, remove, fix_all, refresh, tabula_rasa, only_host_labels, update_service_labels, monitor_undecided_services]
+ choices: [new, remove, fix_all, refresh, tabula_rasa, only_host_labels, only_service_labels, monitor_undecided_services]
do_full_scan:
description: The option whether to perform a full scan or not. (Bulk mode only).
type: bool
@@ -131,13 +131,8 @@
False,
"The service discovery background job has been initialized. Redirecting to the 'Wait for service discovery completion' endpoint.",
),
- 400: (False, True, "Bad Request."),
- 403: (False, True, "Forbidden: Configuration via WATO is disabled."),
404: (False, True, "Not Found: Host could not be found."),
- 406: (False, True, "Not Acceptable."),
409: (False, False, "Conflict: A discovery background job is already running"),
- 415: (False, True, "Unsupported Media Type."),
- 500: (False, True, "General Server Error."),
}
HTTP_CODES_SC = {
@@ -148,30 +143,19 @@
False,
"The service discovery is still running. Redirecting to the 'Wait for completion' endpoint.",
),
- 403: (False, True, "Forbidden: Configuration via Setup is disabled."),
404: (False, False, "Not Found: There is no running service discovery"),
- 406: (False, True, "Not Acceptable."),
- 500: (False, True, "General Server Error."),
}
HTTP_CODES_BULK = {
# http_code: (changed, failed, "Message")
200: (True, False, "Discovery successful."),
- 400: (False, True, "Bad Request."),
- 403: (False, True, "Forbidden: Configuration via WATO is disabled."),
- 406: (False, True, "Not Acceptable."),
409: (False, False, "Conflict: A bulk discovery job is already active"),
- 415: (False, True, "Unsupported Media Type."),
- 500: (False, True, "General Server Error."),
}
HTTP_CODES_BULK_SC = {
# http_code: (changed, failed, "Message")
200: (True, False, "The service discovery has been completed."),
- 403: (False, True, "Forbidden: Configuration via WATO is disabled."),
404: (False, False, "Not Found: There is no running bulk_discovery job"),
- 406: (False, True, "Not Acceptable."),
- 500: (False, True, "General Server Error."),
}
@@ -255,7 +239,7 @@ def post(self):
options["monitor_undecided_services"] = True
if self.params.get("state") in ["remove", "fix_all"]:
options["remove_vanished_services"] = True
- if self.params.get("state") in ["update_service_labels"]:
+ if self.params.get("state") in ["only_service_labels"]:
options["update_service_labels"] = True
if self.params.get("state") in ["new", "fix_all", "only_host_labels"]:
options["update_host_labels"] = True
@@ -336,7 +320,7 @@ def run_module():
"refresh",
"tabula_rasa",
"only_host_labels",
- "update_service_labels",
+ "only_service_labels",
"monitor_undecided_services",
],
),
@@ -400,7 +384,7 @@ def run_module():
module.params["state"] = "refresh"
if module.params.get("state") in [
- "update_service_labels",
+ "only_service_labels",
"monitor_undecided_services",
]:
if ver < CheckmkVersion("2.3.0"):
@@ -426,7 +410,7 @@ def run_module():
module.fail_json(**result_as_dict(result))
if module.params.get(
"state"
- ) == "update_service_labels" and ver < CheckmkVersion("2.3.0p3"):
+ ) == "only_service_labels" and ver < CheckmkVersion("2.3.0p3"):
result = RESULT(
http_code=0,
msg="State can only be used in bulk mode",
diff --git a/plugins/modules/password.py b/plugins/modules/password.py
index 77f4e824b..16774ab96 100644
--- a/plugins/modules/password.py
+++ b/plugins/modules/password.py
@@ -132,90 +132,12 @@
# We count 404 not as failed, because we want to know if the password exists or not.
HTTP_CODES_GET = {
# http_code: (changed, failed, "Message")
- 200: (True, False, "OK: The operation was done successfully."),
- 400: (False, True, "Bad Request: Parameter or validation failure."),
- 403: (False, True, "Forbidden: Configuration via Setup is disabled."),
404: (False, False, "Not Found: The requested object has not been found."),
- 406: (
- False,
- True,
- "Not Acceptable: The requests accept headers can not be satisfied.",
- ),
- 415: (
- False,
- True,
- "Unsupported Media Type: The submitted content-type is not supported.",
- ),
- 500: (False, True, "General Server Error."),
}
HTTP_CODES_DELETE = {
# http_code: (changed, failed, "Message")
- 200: (True, False, "OK: The operation was done successfully."),
- 400: (False, True, "Bad Request: Parameter or validation failure."),
- 403: (False, True, "Forbidden: Configuration via Setup is disabled."),
404: (False, False, "Not Found: The requested object has not been found."),
- 406: (
- False,
- True,
- "Not Acceptable: The requests accept headers can not be satisfied.",
- ),
- 415: (
- False,
- True,
- "Unsupported Media Type: The submitted content-type is not supported.",
- ),
- 500: (False, True, "General Server Error."),
-}
-
-HTTP_CODES_CREATE = {
- # http_code: (changed, failed, "Message")
- 200: (True, False, "OK: The operation was done successfully."),
- 400: (False, True, "Bad Request: Parameter or validation failure."),
- 403: (False, True, "Forbidden: Configuration via Setup is disabled."),
- 406: (
- False,
- True,
- "Not Acceptable: The requests accept headers can not be satisfied.",
- ),
- 415: (
- False,
- True,
- "Unsupported Media Type: The submitted content-type is not supported.",
- ),
- 500: (False, True, "General Server Error."),
-}
-
-HTTP_CODES_UPDATE = {
- # http_code: (changed, failed, "Message")
- 200: (
- True,
- False,
- "No Content: Operation was done successfully. No further output",
- ),
- 403: (False, True, "Forbidden: Configuration via Setup is disabled."),
- 404: (False, True, "Not Found: The requested object has not been found."),
- 406: (
- False,
- True,
- "Not Acceptable: The requests accept headers can not be satisfied.",
- ),
- 412: (
- False,
- True,
- "Precondition Failed: The value of the If-Match header doesn't match the object's ETag.",
- ),
- 415: (
- False,
- True,
- "Unsupported Media Type: The submitted content-type is not supported.",
- ),
- 428: (
- False,
- True,
- "Precondition Required: The required If-Match header is missing.",
- ),
- 500: (False, True, "General Server Error."),
}
@@ -236,7 +158,6 @@ def post(self):
data = {key: val for key, val in data.items() if val}
return self._fetch(
- code_mapping=HTTP_CODES_CREATE,
endpoint="/domain-types/password/collections/all",
data=data,
method="POST",
@@ -259,7 +180,6 @@ def put(self):
data = {key: val for key, val in data.items() if val}
return self._fetch(
- code_mapping=HTTP_CODES_UPDATE,
endpoint="/objects/password/%s" % self.params.get("name"),
data=data,
method="PUT",
diff --git a/plugins/modules/rule.py b/plugins/modules/rule.py
index 3c0b56958..3b37852d1 100644
--- a/plugins/modules/rule.py
+++ b/plugins/modules/rule.py
@@ -101,7 +101,7 @@
- Lars Getwan (@lgetwan)
- diademiemi (@diademiemi)
- Geoffroy Stévenne (@geof77)
- - Michael Sekana (@msekania)
+ - Michael Sekania (@msekania)
"""
EXAMPLES = r"""
diff --git a/plugins/modules/tag_group.py b/plugins/modules/tag_group.py
index 90f61a36a..e3e21605d 100644
--- a/plugins/modules/tag_group.py
+++ b/plugins/modules/tag_group.py
@@ -138,37 +138,7 @@
# We count 404 not as failed, because we want to know if the taggroup exists or not.
HTTP_CODES_GET = {
# http_code: (changed, failed, "Message")
- 200: (True, False, "OK: The operation was done successfully."),
404: (False, False, "Not Found: The requested object has not been found."),
- 500: (False, True, "General Server Error."),
-}
-
-HTTP_CODES_DELETE = {
- # http_code: (changed, failed, "Message")
- 405: (
- False,
- True,
- "Method Not Allowed: This request is only allowed with other HTTP methods",
- ),
- 500: (False, True, "General Server Error."),
-}
-
-HTTP_CODES_CREATE = {
- # http_code: (changed, failed, "Message")
- 200: (True, False, "OK: The operation was done successfully."),
- 500: (False, True, "General Server Error."),
-}
-
-HTTP_CODES_UPDATE = {
- # http_code: (changed, failed, "Message")
- 200: (True, False, "OK: The operation was done successfully."),
- 401: (False, True, "Unauthorized: The user is not authorized to do this request"),
- 405: (
- False,
- True,
- "Method Not Allowed: This request is only allowed with other HTTP methods",
- ),
- 500: (False, True, "General Server Error."),
}
@@ -211,7 +181,6 @@ def post(self):
data["ident"] = self.params.get("name")
return self._fetch(
- code_mapping=HTTP_CODES_CREATE,
endpoint="/domain-types/host_tag_group/collections/all",
data=data,
method="POST",
@@ -223,7 +192,6 @@ def put(self):
data = normalize_data(self.params)
return self._fetch(
- code_mapping=HTTP_CODES_UPDATE,
endpoint="/objects/host_tag_group/%s" % self.params.get("name"),
data=data,
method="PUT",
@@ -235,7 +203,6 @@ def delete(self):
data = {}
return self._fetch(
- code_mapping=HTTP_CODES_DELETE,
endpoint="/objects/host_tag_group/%s?repair=%s"
% (self.params.get("name"), self.params.get("repair")),
# data=data,
diff --git a/plugins/modules/timeperiod.py b/plugins/modules/timeperiod.py
index 11db106dc..19d3da4ec 100644
--- a/plugins/modules/timeperiod.py
+++ b/plugins/modules/timeperiod.py
@@ -148,110 +148,7 @@
# We count 404 not as failed, because we want to know if the time period exists or not.
HTTP_CODES_GET = {
# http_code: (changed, failed, "Message")
- 200: (True, False, "OK: The operation was done successfully."),
- 400: (False, True, "Bad Request: Parameter or validation failure."),
- 403: (False, True, "Forbidden: Configuration via Setup is disabled."),
404: (False, False, "Not Found: The requested object has not been found."),
- 406: (
- False,
- True,
- "Not Acceptable: The requests accept headers can not be satisfied.",
- ),
- 415: (
- False,
- True,
- "Unsupported Media Type: The submitted content-type is not supported.",
- ),
- 500: (False, True, "General Server Error."),
-}
-
-HTTP_CODES_DELETE = {
- # http_code: (changed, failed, "Message")
- 204: (True, False, "No Content: Operation done successfully. No further output."),
- 400: (False, True, "Bad Request: Parameter or validation failure."),
- 403: (False, True, "Forbidden: Configuration via Setup is disabled."),
- 404: (False, True, "Not Found: The requested object has not been found."),
- 405: (
- False,
- True,
- "Method Not Allowed: This request is only allowed with other HTTP methods",
- ),
- 406: (
- False,
- True,
- "Not Acceptable: The requests accept headers can not be satisfied.",
- ),
- 412: (
- False,
- True,
- "Precondition Failed: The value of the If-Match header doesn't match the object's ETag.",
- ),
- 415: (
- False,
- True,
- "Unsupported Media Type: The submitted content-type is not supported.",
- ),
- 428: (
- False,
- True,
- "Precondition Required: The required If-Match header is missing",
- ),
- 500: (False, True, "General Server Error."),
-}
-
-HTTP_CODES_CREATE = {
- # http_code: (changed, failed, "Message")
- 200: (True, False, "OK: The operation was done successfully."),
- 400: (False, True, "Bad Request: Parameter or validation failure."),
- 403: (False, True, "Forbidden: Configuration via Setup is disabled."),
- 406: (
- False,
- True,
- "Not Acceptable: The requests accept headers can not be satisfied.",
- ),
- 415: (
- False,
- True,
- "Unsupported Media Type: The submitted content-type is not supported.",
- ),
- 500: (False, True, "General Server Error."),
-}
-
-HTTP_CODES_UPDATE = {
- # http_code: (changed, failed, "Message")
- 200: (
- True,
- False,
- "No Content: Operation was done successfully. No further output",
- ),
- 403: (False, True, "Forbidden: Configuration via Setup is disabled."),
- 404: (False, True, "Not Found: The requested object has not been found."),
- 405: (
- False,
- True,
- "Method Not Allowed: This request is only allowed with other HTTP methods",
- ),
- 406: (
- False,
- True,
- "Not Acceptable: The requests accept headers can not be satisfied.",
- ),
- 412: (
- False,
- True,
- "Precondition Failed: The value of the If-Match header doesn't match the object's ETag.",
- ),
- 415: (
- False,
- True,
- "Unsupported Media Type: The submitted content-type is not supported.",
- ),
- 428: (
- False,
- True,
- "Precondition Required: The required If-Match header is missing",
- ),
- 500: (False, True, "General Server Error."),
}
updatevalues = ("alias", "active_time_ranges", "exceptions", "exclude")
@@ -272,7 +169,6 @@ def post(self):
data["exclude"] = self.params.get("exclude")
return self._fetch(
- code_mapping=HTTP_CODES_CREATE,
endpoint="/domain-types/time_period/collections/all",
data=data,
method="POST",
@@ -299,7 +195,6 @@ def put(self, existingalias):
data["exclude"] = self.params.get("exclude")
return self._fetch(
- code_mapping=HTTP_CODES_UPDATE,
endpoint="/objects/time_period/%s" % self.params.get("name"),
data=data,
method="PUT",
@@ -311,7 +206,6 @@ def delete(self):
data = {}
return self._fetch(
- code_mapping=HTTP_CODES_DELETE,
endpoint="/objects/time_period/%s" % self.params.get("name"),
data=data,
method="DELETE",
diff --git a/plugins/modules/user.py b/plugins/modules/user.py
index baffe3c16..d9d3fe9c7 100644
--- a/plugins/modules/user.py
+++ b/plugins/modules/user.py
@@ -236,9 +236,6 @@
from ansible_collections.checkmk.general.plugins.module_utils.utils import (
result_as_dict,
)
-from ansible_collections.checkmk.general.plugins.module_utils.version import (
- CheckmkVersion,
-)
USER = (
"username",
@@ -409,19 +406,6 @@ def needs_editing(self):
return True
return False
- def shortpassword(self, data):
- ver = self.getversion()
- if ver >= CheckmkVersion("2.3.0") and "auth_option" in data:
- if (
- "password" in data["auth_option"]
- and len(data["auth_option"]["password"]) < 12
- ) or (
- "secret" in data["auth_option"]
- and len(data["auth_option"]["secret"]) < 10
- ):
- return True
- return False
-
def get(self):
result = self._fetch(
code_mapping=UserHTTPCodes.get,
@@ -454,22 +438,12 @@ def edit(self, etag):
data = self._build_user_data()
self.headers["if-Match"] = etag
- if self.shortpassword(data):
- result = RESULT(
- http_code=0,
- msg="Password too short. For 2.3 and higher, please provide at least 12 characters (automation min. 10).",
- content="",
- etag="",
- failed=True,
- changed=False,
- )
- else:
- result = self._fetch(
- code_mapping=UserHTTPCodes.edit,
- endpoint=self._build_default_endpoint(),
- data=data,
- method="PUT",
- )
+ result = self._fetch(
+ code_mapping=UserHTTPCodes.edit,
+ endpoint=self._build_default_endpoint(),
+ data=data,
+ method="PUT",
+ )
return result
diff --git a/requirements.txt b/requirements.txt
index 618ae37ff..b838767ab 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,4 +6,5 @@ jinja2
molecule >= 5.0.1
molecule-plugins[docker]
yamllint
-pywinrm
\ No newline at end of file
+pywinrm
+netaddr
\ No newline at end of file
diff --git a/roles/agent/README.md b/roles/agent/README.md
index 77d39915d..279641e59 100644
--- a/roles/agent/README.md
+++ b/roles/agent/README.md
@@ -11,9 +11,12 @@ It can be installed as easy as running:
ansible-galaxy collection install checkmk.general
+Additionally, this role requires the Python module `netaddr` on the controller.
+Please make sure it is installed on your system and available for Ansible.
+
## Role Variables
- checkmk_agent_version: "2.3.0p4"
+ checkmk_agent_version: "2.3.0p5"
The Checkmk version of the site your agents will talk to.
@@ -134,6 +137,12 @@ Automatically configure the firewall (*currently only on RedHat and Debian deriv
When checkmk_agent_configure_firewall is set to `true` then configure the firewall zone on RedHat derivatives. Defaults to 'public'.
+ checkmk_agent_server_ips: []
+
+A list of IP addresses, that will be whitelisted in the firewall for agent access on `checkmk_agent_port`.
+The `checkmk_agent_server` will automatically be added, but only if it is an IP address.
+This parameter also does **not** take care of any agent-side whitelisting!
+
checkmk_agent_force_install: 'false'
Force the installation of the agent package, no matter the constraints.
diff --git a/roles/agent/defaults/main.yml b/roles/agent/defaults/main.yml
index d1a2132ad..950b35e94 100644
--- a/roles/agent/defaults/main.yml
+++ b/roles/agent/defaults/main.yml
@@ -1,5 +1,5 @@
---
-checkmk_agent_version: "2.3.0p4"
+checkmk_agent_version: "2.3.0p5"
checkmk_agent_edition: cre
checkmk_agent_server_protocol: http
checkmk_agent_server: localhost
@@ -23,6 +23,7 @@ checkmk_agent_update: 'false'
checkmk_agent_tls: 'false'
checkmk_agent_configure_firewall: 'true'
checkmk_agent_configure_firewall_zone: 'public'
+checkmk_agent_server_ips: []
checkmk_agent_force_install: 'false'
checkmk_agent_prep_legacy: 'false'
checkmk_agent_delegate_api_calls: localhost
diff --git a/roles/agent/molecule/2.1.0/converge.yml b/roles/agent/molecule/2.1.0/converge.yml
index 355915cd1..54ff31445 100644
--- a/roles/agent/molecule/2.1.0/converge.yml
+++ b/roles/agent/molecule/2.1.0/converge.yml
@@ -9,6 +9,7 @@
update_cache: true
cache_valid_time: 600
when: ansible_os_family == 'Debian'
+
- name: Install prerequisites.
ansible.builtin.apt:
name: "{{ item }}"
@@ -16,7 +17,17 @@
loop:
- apt-utils
- man
+ - ufw
when: ansible_os_family == 'Debian'
+
+ - name: Install prerequisites.
+ ansible.builtin.dnf:
+ name: "{{ item }}"
+ state: present
+ loop:
+ - firewalld
+ when: ansible_os_family == 'RedHat'
+
- name: Create '/usr/share/man/man8/' on Ubuntu.
ansible.builtin.file:
path: /usr/share/man/man8/
diff --git a/roles/agent/molecule/2.1.0/group_vars/all.yml b/roles/agent/molecule/2.1.0/group_vars/all.yml
index 339d30244..b7436414d 100644
--- a/roles/agent/molecule/2.1.0/group_vars/all.yml
+++ b/roles/agent/molecule/2.1.0/group_vars/all.yml
@@ -28,8 +28,13 @@ checkmk_agent_add_host: 'true'
checkmk_agent_discover: 'true'
checkmk_agent_discover_max_parallel_tasks: 2
checkmk_agent_update: 'false'
-checkmk_agent_tls: 'false'
-checkmk_agent_configure_firewall: 'false'
+checkmk_agent_tls: 'true'
+checkmk_agent_configure_firewall: 'true'
+checkmk_agent_configure_firewall_zone: 'public'
+checkmk_agent_server_ips:
+ - 10.10.10.10
+ - 172.16.16.16
+ - 192.168.1.1
checkmk_agent_force_install: 'false'
checkmk_agent_prep_legacy: 'false'
checkmk_agent_delegate_api_calls: "{{ inventory_hostname }}"
diff --git a/roles/agent/molecule/2.1.0/molecule.yml b/roles/agent/molecule/2.1.0/molecule.yml
index 26b1538bb..b093f6725 100644
--- a/roles/agent/molecule/2.1.0/molecule.yml
+++ b/roles/agent/molecule/2.1.0/molecule.yml
@@ -5,16 +5,17 @@ dependency:
driver:
name: docker
platforms:
- - name: ubuntu2004
- image: geerlingguy/docker-ubuntu2004-ansible
- command: ${MOLECULE_DOCKER_COMMAND:-""}
- cgroupns_mode: host
- tmpfs:
- - /run
- volumes:
- - /sys/fs/cgroup:/sys/fs/cgroup:rw
- privileged: true
- pre_build_image: true
+ ## Disable for now, as something between Docker, Ubuntu and the UFW Ansible module does not seem to get along.
+ # - name: ubuntu2004
+ # image: geerlingguy/docker-ubuntu2004-ansible
+ # command: ${MOLECULE_DOCKER_COMMAND:-""}
+ # cgroupns_mode: host
+ # tmpfs:
+ # - /run
+ # volumes:
+ # - /sys/fs/cgroup:/sys/fs/cgroup:rw
+ # privileged: true
+ # pre_build_image: true
- name: ubuntu2204
image: geerlingguy/docker-ubuntu2204-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
@@ -45,16 +46,6 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: centos8
- image: geerlingguy/docker-centos8-ansible
- command: ${MOLECULE_DOCKER_COMMAND:-""}
- cgroupns_mode: host
- tmpfs:
- - /run
- volumes:
- - /sys/fs/cgroup:/sys/fs/cgroup:rw
- privileged: true
- pre_build_image: true
- name: rockylinux9
image: geerlingguy/docker-rockylinux9-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
diff --git a/roles/agent/molecule/2.2.0/converge.yml b/roles/agent/molecule/2.2.0/converge.yml
index 6fa62fce9..54ff31445 100644
--- a/roles/agent/molecule/2.2.0/converge.yml
+++ b/roles/agent/molecule/2.2.0/converge.yml
@@ -17,8 +17,17 @@
loop:
- apt-utils
- man
+ - ufw
when: ansible_os_family == 'Debian'
+ - name: Install prerequisites.
+ ansible.builtin.dnf:
+ name: "{{ item }}"
+ state: present
+ loop:
+ - firewalld
+ when: ansible_os_family == 'RedHat'
+
- name: Create '/usr/share/man/man8/' on Ubuntu.
ansible.builtin.file:
path: /usr/share/man/man8/
diff --git a/roles/agent/molecule/2.2.0/group_vars/all.yml b/roles/agent/molecule/2.2.0/group_vars/all.yml
index fd0876c52..d6c2cb9b2 100644
--- a/roles/agent/molecule/2.2.0/group_vars/all.yml
+++ b/roles/agent/molecule/2.2.0/group_vars/all.yml
@@ -28,8 +28,13 @@ checkmk_agent_add_host: 'true'
checkmk_agent_discover: 'true'
checkmk_agent_discover_max_parallel_tasks: 2
checkmk_agent_update: 'false'
-checkmk_agent_tls: 'false'
-checkmk_agent_configure_firewall: 'false'
+checkmk_agent_tls: 'true'
+checkmk_agent_configure_firewall: 'true'
+checkmk_agent_configure_firewall_zone: 'public'
+checkmk_agent_server_ips:
+ - 10.10.10.10
+ - 172.16.16.16
+ - 192.168.1.1
checkmk_agent_force_install: 'false'
checkmk_agent_prep_legacy: 'false'
checkmk_agent_delegate_api_calls: "{{ inventory_hostname }}"
diff --git a/roles/agent/molecule/2.2.0/molecule.yml b/roles/agent/molecule/2.2.0/molecule.yml
index 26b1538bb..c95ee9721 100644
--- a/roles/agent/molecule/2.2.0/molecule.yml
+++ b/roles/agent/molecule/2.2.0/molecule.yml
@@ -5,8 +5,19 @@ dependency:
driver:
name: docker
platforms:
- - name: ubuntu2004
- image: geerlingguy/docker-ubuntu2004-ansible
+ ## Disable for now, as something between Docker, Ubuntu and the UFW Ansible module does not seem to get along.
+ # - name: ubuntu2004
+ # image: geerlingguy/docker-ubuntu2004-ansible
+ # command: ${MOLECULE_DOCKER_COMMAND:-""}
+ # cgroupns_mode: host
+ # tmpfs:
+ # - /run
+ # volumes:
+ # - /sys/fs/cgroup:/sys/fs/cgroup:rw
+ # privileged: true
+ # pre_build_image: true
+ - name: ubuntu2204
+ image: geerlingguy/docker-ubuntu2204-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
tmpfs:
@@ -15,8 +26,8 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: ubuntu2204
- image: geerlingguy/docker-ubuntu2204-ansible
+ - name: ubuntu2404
+ image: geerlingguy/docker-ubuntu2404-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
tmpfs:
@@ -45,16 +56,6 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: centos8
- image: geerlingguy/docker-centos8-ansible
- command: ${MOLECULE_DOCKER_COMMAND:-""}
- cgroupns_mode: host
- tmpfs:
- - /run
- volumes:
- - /sys/fs/cgroup:/sys/fs/cgroup:rw
- privileged: true
- pre_build_image: true
- name: rockylinux9
image: geerlingguy/docker-rockylinux9-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
diff --git a/roles/agent/molecule/2.3.0/converge.yml b/roles/agent/molecule/2.3.0/converge.yml
index 6fa62fce9..54ff31445 100644
--- a/roles/agent/molecule/2.3.0/converge.yml
+++ b/roles/agent/molecule/2.3.0/converge.yml
@@ -17,8 +17,17 @@
loop:
- apt-utils
- man
+ - ufw
when: ansible_os_family == 'Debian'
+ - name: Install prerequisites.
+ ansible.builtin.dnf:
+ name: "{{ item }}"
+ state: present
+ loop:
+ - firewalld
+ when: ansible_os_family == 'RedHat'
+
- name: Create '/usr/share/man/man8/' on Ubuntu.
ansible.builtin.file:
path: /usr/share/man/man8/
diff --git a/roles/agent/molecule/2.3.0/group_vars/all.yml b/roles/agent/molecule/2.3.0/group_vars/all.yml
index b3f20ebc8..11a82eb53 100644
--- a/roles/agent/molecule/2.3.0/group_vars/all.yml
+++ b/roles/agent/molecule/2.3.0/group_vars/all.yml
@@ -1,6 +1,6 @@
---
# General
-checkmk_var_version: "2.3.0p4"
+checkmk_var_version: "2.3.0p5"
checkmk_var_edition: "cre"
checkmk_var_checkmk_site: "mysite"
checkmk_var_automation_user: "cmkadmin"
@@ -28,8 +28,13 @@ checkmk_agent_add_host: 'true'
checkmk_agent_discover: 'true'
checkmk_agent_discover_max_parallel_tasks: 2
checkmk_agent_update: 'false'
-checkmk_agent_tls: 'false'
-checkmk_agent_configure_firewall: 'false'
+checkmk_agent_tls: 'true'
+checkmk_agent_configure_firewall: 'true'
+checkmk_agent_configure_firewall_zone: 'public'
+checkmk_agent_server_ips:
+ - 10.10.10.10
+ - 172.16.16.16
+ - 192.168.1.1
checkmk_agent_force_install: 'false'
checkmk_agent_prep_legacy: 'false'
checkmk_agent_delegate_api_calls: "{{ inventory_hostname }}"
diff --git a/roles/agent/molecule/2.3.0/molecule.yml b/roles/agent/molecule/2.3.0/molecule.yml
index 26b1538bb..c95ee9721 100644
--- a/roles/agent/molecule/2.3.0/molecule.yml
+++ b/roles/agent/molecule/2.3.0/molecule.yml
@@ -5,8 +5,19 @@ dependency:
driver:
name: docker
platforms:
- - name: ubuntu2004
- image: geerlingguy/docker-ubuntu2004-ansible
+ ## Disable for now, as something between Docker, Ubuntu and the UFW Ansible module does not seem to get along.
+ # - name: ubuntu2004
+ # image: geerlingguy/docker-ubuntu2004-ansible
+ # command: ${MOLECULE_DOCKER_COMMAND:-""}
+ # cgroupns_mode: host
+ # tmpfs:
+ # - /run
+ # volumes:
+ # - /sys/fs/cgroup:/sys/fs/cgroup:rw
+ # privileged: true
+ # pre_build_image: true
+ - name: ubuntu2204
+ image: geerlingguy/docker-ubuntu2204-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
tmpfs:
@@ -15,8 +26,8 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: ubuntu2204
- image: geerlingguy/docker-ubuntu2204-ansible
+ - name: ubuntu2404
+ image: geerlingguy/docker-ubuntu2404-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
tmpfs:
@@ -45,16 +56,6 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: centos8
- image: geerlingguy/docker-centos8-ansible
- command: ${MOLECULE_DOCKER_COMMAND:-""}
- cgroupns_mode: host
- tmpfs:
- - /run
- volumes:
- - /sys/fs/cgroup:/sys/fs/cgroup:rw
- privileged: true
- pre_build_image: true
- name: rockylinux9
image: geerlingguy/docker-rockylinux9-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
diff --git a/roles/agent/tasks/Debian.yml b/roles/agent/tasks/Debian.yml
index 78df40bb1..b1a80d255 100644
--- a/roles/agent/tasks/Debian.yml
+++ b/roles/agent/tasks/Debian.yml
@@ -47,17 +47,18 @@
- name: "{{ ansible_os_family }} Derivatives: Configure Firewall for Agent."
when: checkmk_agent_configure_firewall | bool and "ufw.service" in ansible_facts.services
block:
- - name: "{{ ansible_os_family }} Derivatives: Check if checkmk_agent_server is an IP address."
+ - name: "{{ ansible_os_family }} Derivatives: Add Checkmk Server to Firewall Whitelist if it is an IP address."
+ when: checkmk_agent_server | ansible.utils.ipaddr()
ansible.builtin.set_fact:
- checkmk_agent_server_ip: "{{ checkmk_agent_server }}"
- when: checkmk_agent_server_ip is not defined and checkmk_agent_server | ansible.utils.ipaddr()
+ checkmk_agent_server_ips: "{{ checkmk_agent_server_ips + [checkmk_agent_server] }}"
- name: "{{ ansible_os_family }} Derivatives: Allow Checkmk services access to the agent."
+ when: checkmk_agent_server_ips is defined
community.general.ufw:
rule: allow
proto: tcp
- src: "{{ checkmk_agent_server_ip }}"
+ src: "{{ item }}"
port: '6556'
comment: Allow Checkmk
- when: checkmk_agent_server_ip is defined
+ loop: "{{ checkmk_agent_server_ips }}"
become: true
diff --git a/roles/agent/tasks/RedHat.yml b/roles/agent/tasks/RedHat.yml
index ada672a3b..b3711add3 100644
--- a/roles/agent/tasks/RedHat.yml
+++ b/roles/agent/tasks/RedHat.yml
@@ -1,7 +1,7 @@
---
- name: "{{ ansible_os_family }} Derivatives: Install host-specific {{ checkmk_agent_edition | upper }} Agent."
become: true
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: "{{ checkmk_agent_agent.file.host }}"
state: present
disable_gpg_check: true
@@ -13,7 +13,7 @@
- name: "{{ ansible_os_family }} Derivatives: Install GENERIC or folder-specific {{ checkmk_agent_edition | upper }} Agent."
become: true
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: "{{ checkmk_agent_agent.file.cee }}"
state: present
disable_gpg_check: true
@@ -36,7 +36,7 @@
- name: "{{ ansible_os_family }} Derivatives: Install Vanilla agent."
become: true
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: "{{ checkmk_agent_agent.file.cre }}"
state: present
disable_gpg_check: true
@@ -47,17 +47,18 @@
- name: "{{ ansible_os_family }} Derivatives: Configure Firewall for Agent."
when: checkmk_agent_configure_firewall | bool and "firewalld.service" in ansible_facts.services
block:
- - name: "{{ ansible_os_family }} Derivatives: Check if checkmk_agent_server is an IP address."
+ - name: "{{ ansible_os_family }} Derivatives: Add Checkmk Server to Firewall Whitelist if it is an IP address."
+ when: checkmk_agent_server | ansible.utils.ipaddr()
ansible.builtin.set_fact:
- checkmk_agent_server_ip: "{{ checkmk_agent_server }}"
- when: checkmk_agent_server_ip is not defined and checkmk_agent_server | ansible.utils.ipaddr()
+ checkmk_agent_server_ips: "{{ checkmk_agent_server_ips + [checkmk_agent_server] }}"
- name: "{{ ansible_os_family }} Derivatives: Allow Checkmk services access to the agent."
+ when: checkmk_agent_server_ips is defined
ansible.posix.firewalld:
permanent: 'yes'
immediate: 'yes'
state: enabled
- rich_rule: 'rule family="ipv4" source address={{ checkmk_agent_server_ip }} port port="{{ checkmk_agent_port }}" protocol="tcp" accept'
+ rich_rule: 'rule family="ipv4" source address={{ item }} port port="{{ checkmk_agent_port }}" protocol="tcp" accept'
zone: "{{ checkmk_agent_configure_firewall_zone | default('public') }}"
- when: checkmk_agent_server_ip is defined
+ loop: "{{ checkmk_agent_server_ips }}"
become: true
diff --git a/roles/server/README.md b/roles/server/README.md
index bdfdb14f1..eee968357 100644
--- a/roles/server/README.md
+++ b/roles/server/README.md
@@ -25,7 +25,7 @@ To learn about the distributions used in automated tests, inspect the correspond
## Role Variables
- checkmk_server_version: "2.3.0p4"
+ checkmk_server_version: "2.3.0p5"
The global Checkmk version. This is used for installing Checkmk.
To manage sites and their version, see `checkmk_server_sites`.
diff --git a/roles/server/defaults/main.yml b/roles/server/defaults/main.yml
index dc4c78fd1..d28f50157 100644
--- a/roles/server/defaults/main.yml
+++ b/roles/server/defaults/main.yml
@@ -23,8 +23,9 @@ checkmk_server_server_stable_os:
- Ubuntu-18
- Ubuntu-20
- Ubuntu-22
+ - Ubuntu-24
-checkmk_server_version: "2.3.0p4"
+checkmk_server_version: "2.3.0p5"
checkmk_server_edition: cre
checkmk_server_verify_setup: 'true'
diff --git a/roles/server/molecule/2.1.0/molecule.yml b/roles/server/molecule/2.1.0/molecule.yml
index 26b1538bb..e5016e217 100644
--- a/roles/server/molecule/2.1.0/molecule.yml
+++ b/roles/server/molecule/2.1.0/molecule.yml
@@ -45,16 +45,6 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: centos8
- image: geerlingguy/docker-centos8-ansible
- command: ${MOLECULE_DOCKER_COMMAND:-""}
- cgroupns_mode: host
- tmpfs:
- - /run
- volumes:
- - /sys/fs/cgroup:/sys/fs/cgroup:rw
- privileged: true
- pre_build_image: true
- name: rockylinux9
image: geerlingguy/docker-rockylinux9-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
diff --git a/roles/server/molecule/2.2.0/molecule.yml b/roles/server/molecule/2.2.0/molecule.yml
index 26b1538bb..694add3be 100644
--- a/roles/server/molecule/2.2.0/molecule.yml
+++ b/roles/server/molecule/2.2.0/molecule.yml
@@ -25,8 +25,8 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: debian11
- image: geerlingguy/docker-debian11-ansible
+ - name: ubuntu2404
+ image: geerlingguy/docker-ubuntu2404-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
tmpfs:
@@ -35,8 +35,8 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: debian12
- image: geerlingguy/docker-debian12-ansible
+ - name: debian11
+ image: geerlingguy/docker-debian11-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
tmpfs:
@@ -45,8 +45,8 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: centos8
- image: geerlingguy/docker-centos8-ansible
+ - name: debian12
+ image: geerlingguy/docker-debian12-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
tmpfs:
diff --git a/roles/server/molecule/2.3.0/group_vars/all.yml b/roles/server/molecule/2.3.0/group_vars/all.yml
index bd9bfe0f4..e2459864d 100644
--- a/roles/server/molecule/2.3.0/group_vars/all.yml
+++ b/roles/server/molecule/2.3.0/group_vars/all.yml
@@ -1,6 +1,6 @@
---
# General
-checkmk_var_version: "2.3.0p4"
+checkmk_var_version: "2.3.0p5"
checkmk_var_edition: "cre"
checkmk_server_verify_setup: 'true'
checkmk_var_server_url: "http://127.0.0.1/"
diff --git a/roles/server/molecule/2.3.0/molecule.yml b/roles/server/molecule/2.3.0/molecule.yml
index 26b1538bb..694add3be 100644
--- a/roles/server/molecule/2.3.0/molecule.yml
+++ b/roles/server/molecule/2.3.0/molecule.yml
@@ -25,8 +25,8 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: debian11
- image: geerlingguy/docker-debian11-ansible
+ - name: ubuntu2404
+ image: geerlingguy/docker-ubuntu2404-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
tmpfs:
@@ -35,8 +35,8 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: debian12
- image: geerlingguy/docker-debian12-ansible
+ - name: debian11
+ image: geerlingguy/docker-debian11-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
tmpfs:
@@ -45,8 +45,8 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
pre_build_image: true
- - name: centos8
- image: geerlingguy/docker-centos8-ansible
+ - name: debian12
+ image: geerlingguy/docker-debian12-ansible
command: ${MOLECULE_DOCKER_COMMAND:-""}
cgroupns_mode: host
tmpfs:
diff --git a/roles/server/tasks/RedHat.yml b/roles/server/tasks/RedHat.yml
index 94685ff74..ecce0dd66 100644
--- a/roles/server/tasks/RedHat.yml
+++ b/roles/server/tasks/RedHat.yml
@@ -26,7 +26,7 @@
- name: "Install epel-release from URL on CentOS & RHEL 8."
become: true
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: "{{ checkmk_server_epel_url }}"
state: present
disable_gpg_check: "{{ not checkmk_server_epel_gpg_check | bool }}"
@@ -79,7 +79,7 @@
- name: "Install Checkmk Server."
when: not 'check-mk-' + checkmk_server_edition_mapping[checkmk_server_edition] + '-' +checkmk_server_version in ansible_facts.packages
become: true
- ansible.builtin.yum:
+ ansible.builtin.dnf:
name: "/tmp/{{ checkmk_server_setup_file }}"
state: present
disable_gpg_check: '{{ not checkmk_server_verify_setup | bool }}'
diff --git a/scripts/release.sh b/scripts/release.sh
index fc3fc168a..bd5ae53ac 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -17,7 +17,7 @@ collection_dir="${script_dir%/*}"
# Update these as necessary:
checkmk_ancient="2.1.0p44"
checkmk_oldstable="2.2.0p27"
-checkmk_stable="2.3.0p4"
+checkmk_stable="2.3.0p5"
while getopts 's:t:' OPTION; do
case "$OPTION" in
diff --git a/tests/integration/targets/activation/vars/main.yml b/tests/integration/targets/activation/vars/main.yml
index 3d4fb4baa..1fd76dde8 100644
--- a/tests/integration/targets/activation/vars/main.yml
+++ b/tests/integration/targets/activation/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/bakery/vars/main.yml b/tests/integration/targets/bakery/vars/main.yml
index 89a1a609f..9b1d69f8c 100644
--- a/tests/integration/targets/bakery/vars/main.yml
+++ b/tests/integration/targets/bakery/vars/main.yml
@@ -1,6 +1,6 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/contact_group/vars/main.yml b/tests/integration/targets/contact_group/vars/main.yml
index 9c6ae2fe6..9af32b735 100644
--- a/tests/integration/targets/contact_group/vars/main.yml
+++ b/tests/integration/targets/contact_group/vars/main.yml
@@ -1,12 +1,12 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cme"
site: "stable_cme"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/discovery/tasks/test.yml b/tests/integration/targets/discovery/tasks/test.yml
index 58de6e161..bc99f6879 100644
--- a/tests/integration/targets/discovery/tasks/test.yml
+++ b/tests/integration/targets/discovery/tasks/test.yml
@@ -72,7 +72,7 @@
automation_user: "{{ checkmk_var_automation_user }}"
automation_secret: "{{ checkmk_var_automation_secret }}"
host_name: "{{ item.name }}"
- state: "update_service_labels"
+ state: "only_service_labels"
delegate_to: localhost
run_once: true # noqa run-once[task]
loop: "{{ checkmk_hosts }}"
@@ -95,19 +95,17 @@
failed_when: "'State is not supported before 2.3.0' not in monitorundecidedservices_output.msg"
when: "not '2.3.0' in outer_item.version"
- - name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Update service labels. (Should fail in 2.3.0)"
+ - name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Update service labels."
discovery:
server_url: "{{ checkmk_var_server_url }}"
site: "{{ outer_item.site }}"
automation_user: "{{ checkmk_var_automation_user }}"
automation_secret: "{{ checkmk_var_automation_secret }}"
host_name: "{{ item.name }}"
- state: "update_service_labels"
+ state: "only_service_labels"
delegate_to: localhost
run_once: true # noqa run-once[task]
loop: "{{ checkmk_hosts }}"
- register: stableupdateservicelabels_output
- failed_when: "'State can only be used in bulk mode' not in stableupdateservicelabels_output.msg"
when: "'2.3.0' in outer_item.version"
- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Monitor undecided services. (Should fail in 2.3.0)"
@@ -245,7 +243,7 @@
automation_user: "{{ checkmk_var_automation_user }}"
automation_secret: "{{ checkmk_var_automation_secret }}"
hosts: "{{ checkmk_host_names }}"
- state: "update_service_labels"
+ state: "only_service_labels"
bulk_size: 5
delegate_to: localhost
register: bulkupdateservicelabels_output
@@ -273,7 +271,7 @@
automation_user: "{{ checkmk_var_automation_user }}"
automation_secret: "{{ checkmk_var_automation_secret }}"
hosts: "{{ checkmk_host_names }}"
- state: "update_service_labels"
+ state: "only_service_labels"
bulk_size: 5
delegate_to: localhost
when: "'2.3.0' in outer_item.version"
diff --git a/tests/integration/targets/discovery/vars/main.yml b/tests/integration/targets/discovery/vars/main.yml
index 337eff8f6..b3b03d38a 100644
--- a/tests/integration/targets/discovery/vars/main.yml
+++ b/tests/integration/targets/discovery/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/downtime/vars/main.yml b/tests/integration/targets/downtime/vars/main.yml
index 92d8d3d46..8c4301d99 100644
--- a/tests/integration/targets/downtime/vars/main.yml
+++ b/tests/integration/targets/downtime/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/folder/vars/main.yml b/tests/integration/targets/folder/vars/main.yml
index 2dde7c289..8b611a37e 100644
--- a/tests/integration/targets/folder/vars/main.yml
+++ b/tests/integration/targets/folder/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/host/vars/main.yml b/tests/integration/targets/host/vars/main.yml
index e8277ac9c..db80bc402 100644
--- a/tests/integration/targets/host/vars/main.yml
+++ b/tests/integration/targets/host/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/host_group/vars/main.yml b/tests/integration/targets/host_group/vars/main.yml
index 12c578d2d..780d6adcf 100644
--- a/tests/integration/targets/host_group/vars/main.yml
+++ b/tests/integration/targets/host_group/vars/main.yml
@@ -1,12 +1,12 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cme"
site: "stable_cme"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/lookup_bakery/vars/main.yml b/tests/integration/targets/lookup_bakery/vars/main.yml
index 189e4a19f..d11082443 100644
--- a/tests/integration/targets/lookup_bakery/vars/main.yml
+++ b/tests/integration/targets/lookup_bakery/vars/main.yml
@@ -1,6 +1,6 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/lookup_folder/vars/main.yml b/tests/integration/targets/lookup_folder/vars/main.yml
index c697f852c..62c0680a6 100644
--- a/tests/integration/targets/lookup_folder/vars/main.yml
+++ b/tests/integration/targets/lookup_folder/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/lookup_folders/vars/main.yml b/tests/integration/targets/lookup_folders/vars/main.yml
index a415ce9ae..c747dd8de 100644
--- a/tests/integration/targets/lookup_folders/vars/main.yml
+++ b/tests/integration/targets/lookup_folders/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/lookup_host/vars/main.yml b/tests/integration/targets/lookup_host/vars/main.yml
index 1737e4cde..b88415831 100644
--- a/tests/integration/targets/lookup_host/vars/main.yml
+++ b/tests/integration/targets/lookup_host/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/lookup_hosts/vars/main.yml b/tests/integration/targets/lookup_hosts/vars/main.yml
index 37e1f2cd1..117af9770 100644
--- a/tests/integration/targets/lookup_hosts/vars/main.yml
+++ b/tests/integration/targets/lookup_hosts/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/lookup_rules/vars/main.yml b/tests/integration/targets/lookup_rules/vars/main.yml
index fcb7bd686..f7aa3234c 100644
--- a/tests/integration/targets/lookup_rules/vars/main.yml
+++ b/tests/integration/targets/lookup_rules/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/lookup_rulesets/vars/main.yml b/tests/integration/targets/lookup_rulesets/vars/main.yml
index 20e901e4a..51efe5775 100644
--- a/tests/integration/targets/lookup_rulesets/vars/main.yml
+++ b/tests/integration/targets/lookup_rulesets/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/lookup_version/vars/main.yml b/tests/integration/targets/lookup_version/vars/main.yml
index 4e1de009d..2f18253b6 100644
--- a/tests/integration/targets/lookup_version/vars/main.yml
+++ b/tests/integration/targets/lookup_version/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/password/vars/main.yml b/tests/integration/targets/password/vars/main.yml
index 73b304256..93100f1dc 100644
--- a/tests/integration/targets/password/vars/main.yml
+++ b/tests/integration/targets/password/vars/main.yml
@@ -1,12 +1,12 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cme"
site: "stable_cme"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/rule/tasks/test.yml b/tests/integration/targets/rule/tasks/test.yml
index bce2ba34f..7e50b4759 100644
--- a/tests/integration/targets/rule/tasks/test.yml
+++ b/tests/integration/targets/rule/tasks/test.yml
@@ -1,4 +1,7 @@
---
+- name: "Include Checkmk version specific Variables."
+ ansible.builtin.include_vars: "{{ outer_item.version | regex_search('^[0-9]+[.][0-9]+[.][0-9]+') }}.yml"
+
- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Create rules."
rule:
server_url: "{{ checkmk_var_server_url }}"
@@ -63,16 +66,16 @@
rule:
rule_id: "{{ item.content.id }}"
conditions: "{{ item.content.extensions.conditions }}"
- properties:
- comment: "{{ item.content.extensions.properties.comment | default('') }}"
- description: "New description"
- value_raw: "{{ item.content.extensions.value_raw }}"
+ properties:
+ comment: "{{ item.content.extensions.properties.comment | default('') }}"
+ description: "New description"
+ value_raw: "{{ item.content.extensions.value_raw | string }}"
state: "present"
delegate_to: localhost
run_once: true # noqa run-once[task]
loop: "{{ created_rules.results }}"
loop_control:
- label: "{{ item.content.id }}"
+ label: "{{ item.content.id }}"
- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Modify rules. Again."
rule:
@@ -84,16 +87,16 @@
rule:
rule_id: "{{ item.content.id }}"
conditions: "{{ item.content.extensions.conditions }}"
- properties:
- comment: "{{ item.content.extensions.properties.comment | default('') }}"
- description: "New description"
- value_raw: "{{ item.content.extensions.value_raw }}"
+ properties:
+ comment: "{{ item.content.extensions.properties.comment | default('') }}"
+ description: "New description"
+ value_raw: "{{ item.content.extensions.value_raw | string }}"
state: "present"
delegate_to: localhost
run_once: true # noqa run-once[task]
loop: "{{ created_rules.results }}"
loop_control:
- label: "{{ item.content.id }}"
+ label: "{{ item.content.id }}"
register: rule_result
- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Fail if changed." # noqa no-handler
@@ -113,25 +116,23 @@
rule:
rule_id: "{{ item.id }}"
conditions: "{{ item.extensions.conditions }}"
- properties:
- comment: "{{ item.extensions.properties.comment }}"
- description: "Even newer description"
- value_raw: "{{ item.extensions.value_raw }}"
+ properties:
+ comment: "{{ item.extensions.properties.comment }}"
+ description: "Even newer description"
+ value_raw: "{{ item.extensions.value_raw | string }}"
state: "present"
delegate_to: localhost
run_once: true # noqa run-once[task]
- loop: "{{ lookup('checkmk.general.rules',
+ loop: "{{ lookup('checkmk.general.rules',
ruleset='checkgroup_parameters:filesystem',
comment_regex='Ansible managed',
server_url=checkmk_var_server_url,
site=outer_item.site,
automation_user=checkmk_var_automation_user,
automation_secret=checkmk_var_automation_secret,
- validate_certs=False
- )
- }}"
+ validate_certs=False) }}"
loop_control:
- label: "{{ item.id }}"
+ label: "{{ item.id }}"
- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Delete rules."
rule:
@@ -147,7 +148,7 @@
run_once: true # noqa run-once[task]
loop: "{{ created_rules.results }}"
loop_control:
- label: "{{ item.content.id }}"
+ label: "{{ item.content.id }}"
- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Activate."
activation:
@@ -161,7 +162,7 @@
delegate_to: localhost
run_once: true # noqa run-once[task]
-- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Delete rules."
+- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Delete rules. Again."
rule:
server_url: "{{ checkmk_var_server_url }}"
site: "{{ outer_item.site }}"
@@ -175,7 +176,7 @@
run_once: true # noqa run-once[task]
loop: "{{ created_rules.results }}"
loop_control:
- label: "{{ item.content.id }}"
+ label: "{{ item.content.id }}"
- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Fail if changed." # noqa no-handler
ansible.builtin.fail:
@@ -183,46 +184,3 @@
when: "rule_result.changed"
delegate_to: localhost
run_once: true # noqa run-once[task]
-
-- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Create rules. Oldschool."
- rule:
- server_url: "{{ checkmk_var_server_url }}"
- site: "{{ outer_item.site }}"
- automation_user: "{{ checkmk_var_automation_user }}"
- automation_secret: "{{ checkmk_var_automation_secret }}"
- ruleset: "{{ item.ruleset }}"
- rule: "{{ item.rule }}"
- state: "present"
- delegate_to: localhost
- run_once: true # noqa run-once[task]
- loop: "{{ checkmk_var_rules }}"
- register: created_rules
-
-- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Create rules again. Oldschool."
- rule:
- server_url: "{{ checkmk_var_server_url }}"
- site: "{{ outer_item.site }}"
- automation_user: "{{ checkmk_var_automation_user }}"
- automation_secret: "{{ checkmk_var_automation_secret }}"
- ruleset: "{{ item.ruleset }}"
- rule: "{{ item.rule }}"
- state: "present"
- delegate_to: localhost
- run_once: true # noqa run-once[task]
- loop: "{{ checkmk_var_rules }}"
- register: created_rules
-
-- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - New label conditions."
- rule:
- server_url: "{{ checkmk_var_server_url }}"
- site: "{{ outer_item.site }}"
- automation_user: "{{ checkmk_var_automation_user }}"
- automation_secret: "{{ checkmk_var_automation_secret }}"
- ruleset: "{{ item.ruleset }}"
- rule: "{{ item.rule }}"
- state: "present"
- delegate_to: localhost
- run_once: true # noqa run-once[task]
- loop: "{{ checkmk_var_rules_230 }}"
- register: created_rules
- when: "'2.3' in outer_item.version"
diff --git a/tests/integration/targets/rule/vars/2.1.0.yml b/tests/integration/targets/rule/vars/2.1.0.yml
new file mode 100644
index 000000000..8a96fd72a
--- /dev/null
+++ b/tests/integration/targets/rule/vars/2.1.0.yml
@@ -0,0 +1,109 @@
+---
+checkmk_var_rules:
+ - name: "Filesystems (used space and growth) - Magic Factor."
+ ruleset: "checkgroup_parameters:filesystem"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'magic': 0.8}"
+
+ - name: "CPU load (not utilization!) - 15 minute load."
+ ruleset: "checkgroup_parameters:cpu_load"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'levels': (1.0, 2.0)}"
+
+ - name: "CPU utilization on Linux/UNIX - Multiple thresholds."
+ ruleset: "checkgroup_parameters:cpu_iowait"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'core_util_time': (100.0, 300, 900), 'core_util_time_total': (100.0, 300, 900)}"
+
+ - name: "Logwatch Event Console Forwarding - Multiple values."
+ ruleset: "checkgroup_parameters:logwatch_ec"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'facility': 17, 'method': '', 'monitor_logfilelist': False}"
+
+ - name: "Simulating SNMP by using a stored SNMP walk - Enable."
+ ruleset: "usewalk_hosts"
+ rule:
+ conditions: {
+ "host_labels": [],
+ "host_tags": [
+ {
+ "key": "snmp_ds",
+ "operator": "is_not",
+ "value": "no-snmp"
+ }
+ ],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "disabled": false,
+ }
+ value_raw: 'True'
+
+ - name: "Memory percentage used - Levels."
+ ruleset: "checkgroup_parameters:memory_percentage_used"
+ rule:
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "Warning at 80%\nCritical at 90%\n",
+ "description": "Allow higher memory usage",
+ "disabled": false,
+ "documentation_url": "https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/modules/rules.py"
+ }
+ value_raw: "{'levels': (80.0, 90.0)}"
diff --git a/tests/integration/targets/rule/vars/2.2.0.yml b/tests/integration/targets/rule/vars/2.2.0.yml
new file mode 100644
index 000000000..8a96fd72a
--- /dev/null
+++ b/tests/integration/targets/rule/vars/2.2.0.yml
@@ -0,0 +1,109 @@
+---
+checkmk_var_rules:
+ - name: "Filesystems (used space and growth) - Magic Factor."
+ ruleset: "checkgroup_parameters:filesystem"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'magic': 0.8}"
+
+ - name: "CPU load (not utilization!) - 15 minute load."
+ ruleset: "checkgroup_parameters:cpu_load"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'levels': (1.0, 2.0)}"
+
+ - name: "CPU utilization on Linux/UNIX - Multiple thresholds."
+ ruleset: "checkgroup_parameters:cpu_iowait"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'core_util_time': (100.0, 300, 900), 'core_util_time_total': (100.0, 300, 900)}"
+
+ - name: "Logwatch Event Console Forwarding - Multiple values."
+ ruleset: "checkgroup_parameters:logwatch_ec"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'facility': 17, 'method': '', 'monitor_logfilelist': False}"
+
+ - name: "Simulating SNMP by using a stored SNMP walk - Enable."
+ ruleset: "usewalk_hosts"
+ rule:
+ conditions: {
+ "host_labels": [],
+ "host_tags": [
+ {
+ "key": "snmp_ds",
+ "operator": "is_not",
+ "value": "no-snmp"
+ }
+ ],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "disabled": false,
+ }
+ value_raw: 'True'
+
+ - name: "Memory percentage used - Levels."
+ ruleset: "checkgroup_parameters:memory_percentage_used"
+ rule:
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "Warning at 80%\nCritical at 90%\n",
+ "description": "Allow higher memory usage",
+ "disabled": false,
+ "documentation_url": "https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/modules/rules.py"
+ }
+ value_raw: "{'levels': (80.0, 90.0)}"
diff --git a/tests/integration/targets/rule/vars/2.3.0.yml b/tests/integration/targets/rule/vars/2.3.0.yml
new file mode 100644
index 000000000..07f6ee6ee
--- /dev/null
+++ b/tests/integration/targets/rule/vars/2.3.0.yml
@@ -0,0 +1,152 @@
+---
+checkmk_var_rules:
+ - name: "Filesystems (used space and growth) - Magic Factor."
+ ruleset: "checkgroup_parameters:filesystem"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'magic': 0.8}"
+
+ - name: "CPU load (not utilization!) - 15 minute load."
+ ruleset: "checkgroup_parameters:cpu_load"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'levels15': (1.0, 2.0)}"
+
+ - name: "CPU utilization on Linux/UNIX - Multiple thresholds."
+ ruleset: "checkgroup_parameters:cpu_iowait"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'core_util_time': (100.0, 300, 900), 'core_util_time_total': (100.0, 300, 900)}"
+
+ - name: "Logwatch Event Console Forwarding - Multiple values."
+ ruleset: "checkgroup_parameters:logwatch_ec"
+ rule:
+ location:
+ folder: "/"
+ position: "bottom"
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "",
+ "description": "",
+ "disabled": false
+ }
+ value_raw: "{'facility': 17, 'method': '', 'monitor_logfilelist': False}"
+
+ - name: "Simulating SNMP by using a stored SNMP walk - Enable."
+ ruleset: "usewalk_hosts"
+ rule:
+ conditions: {
+ "host_labels": [],
+ "host_tags": [
+ {
+ "key": "snmp_ds",
+ "operator": "is_not",
+ "value": "no-snmp"
+ }
+ ],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
+ "disabled": false,
+ }
+ value_raw: 'True'
+
+ - name: "Memory percentage used - Levels."
+ ruleset: "checkgroup_parameters:memory_percentage_used"
+ rule:
+ conditions: {
+ "host_labels": [],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "Warning at 80%\nCritical at 90%\n",
+ "description": "Allow higher memory usage",
+ "disabled": false,
+ "documentation_url": "https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/modules/rules.py"
+ }
+ value_raw: "{'levels': (80.0, 90.0)}"
+
+ - name: "Memory percentage used - Combined host label conditions."
+ ruleset: "checkgroup_parameters:memory_percentage_used"
+ rule:
+ conditions: {
+ "host_label_groups": [
+ {
+ operator: "and",
+ label_group: [
+ {
+ operator: "and",
+ label: "cmk/site:beta"
+ },
+ {
+ operator: "or",
+ label: "cmk/os_family:linux"
+ }
+ ],
+ },
+ {
+ operator: "or",
+ label_group: [
+ {
+ operator: "and",
+ label: "cmk/site:alpha"
+ },
+ {
+ operator: "or",
+ label: "cmk/os_family:windows"
+ }
+ ],
+ },
+ ],
+ "host_tags": [],
+ "service_labels": []
+ }
+ properties: {
+ "comment": "Warning at 70%\nCritical at 80%\n",
+ "description": "Allow higher memory usage for certain host label conditions",
+ "disabled": false,
+ "documentation_url": "https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/modules/rules.py"
+ }
+ value_raw: "{'levels': (70.0, 80.0)}"
diff --git a/tests/integration/targets/rule/vars/main.yml b/tests/integration/targets/rule/vars/main.yml
index 7002b3023..2f18253b6 100644
--- a/tests/integration/targets/rule/vars/main.yml
+++ b/tests/integration/targets/rule/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
@@ -12,153 +12,3 @@ test_sites:
- version: "2.1.0p44"
edition: "cre"
site: "ancient_cre"
-
-checkmk_var_rules:
- - name: "Filesystem - Magic Factor."
- ruleset: "checkgroup_parameters:filesystem"
- rule:
- location:
- folder: "/"
- position: "bottom"
- conditions: {
- "host_labels": [],
- "host_tags": [],
- "service_labels": []
- }
- properties: {
- "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
- "description": "",
- "disabled": false
- }
- value_raw: "{'magic': 0.8}"
-
- - name: "CPU - Load."
- ruleset: "checkgroup_parameters:cpu_load"
- rule:
- location:
- folder: "/"
- position: "bottom"
- conditions: {
- "host_labels": [],
- "host_tags": [],
- "service_labels": []
- }
- properties: {
- "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
- "description": "",
- "disabled": false
- }
- value_raw: "{'levels': (1.0, 2.0)}"
-
- - name: "CPU - Utilization."
- ruleset: "checkgroup_parameters:cpu_iowait"
- rule:
- location:
- folder: "/"
- position: "bottom"
- conditions: {
- "host_labels": [],
- "host_tags": [],
- "service_labels": []
- }
- properties: {
- "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
- "description": "",
- "disabled": false
- }
- value_raw: "{'core_util_time': (100.0, 300, 900), 'core_util_time_total': (100.0, 300, 900)}"
-
- - name: "Logwatch - Event Console Forwarding."
- ruleset: "checkgroup_parameters:logwatch_ec"
- rule:
- location:
- folder: "/"
- position: "bottom"
- conditions: {
- "host_labels": [],
- "host_tags": [],
- "service_labels": []
- }
- properties: {
- "comment": "",
- "description": "",
- "disabled": false
- }
- value_raw: "{'facility': 17, 'method': '', 'monitor_logfilelist': False}"
-
- - ruleset: "usewalk_hosts"
- rule:
- conditions: {
- "host_labels": [],
- "host_tags": [
- {
- "key": "snmp_ds",
- "operator": "is_not",
- "value": "no-snmp"
- }
- ],
- "service_labels": []
- }
- properties: {
- "comment": "{{ ansible_date_time.iso8601 }} - Ansible managed",
- "disabled": false,
- }
- value_raw: 'True'
-
- - ruleset: "checkgroup_parameters:memory_percentage_used"
- rule:
- conditions: {
- "host_labels": [],
- "host_tags": [],
- "service_labels": []
- }
- properties: {
- "comment": "Warning at 80%\nCritical at 90%\n",
- "description": "Allow higher memory usage",
- "disabled": false,
- "documentation_url": "https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/modules/rules.py"
- }
- value_raw: "{'levels': (80.0, 90.0)}"
-
-checkmk_var_rules_230:
- - ruleset: "checkgroup_parameters:memory_percentage_used"
- rule:
- conditions: {
- "host_label_groups": [
- {
- operator: "and",
- label_group: [
- {
- operator: "and",
- label: "cmk/site:beta"
- },
- {
- operator: "or",
- label: "cmk/os_family:linux"
- }
- ],
- },
- {
- operator: "or",
- label_group: [
- {
- operator: "and",
- label: "cmk/site:alpha"
- },
- {
- operator: "or",
- label: "cmk/os_family:windows"
- }
- ],
- },
- ],
- "host_tags": [],
- "service_labels": []
- }
- properties: {
- "comment": "Warning at 70%\nCritical at 80%\n",
- "description": "Allow higher memory usage for certain host label conditions",
- "disabled": false,
- "documentation_url": "https://github.com/Checkmk/ansible-collection-checkmk.general/blob/main/plugins/modules/rules.py"
- }
- value_raw: "{'levels': (70.0, 80.0)}"
diff --git a/tests/integration/targets/service_group/vars/main.yml b/tests/integration/targets/service_group/vars/main.yml
index 53340f522..62ebec255 100644
--- a/tests/integration/targets/service_group/vars/main.yml
+++ b/tests/integration/targets/service_group/vars/main.yml
@@ -1,12 +1,12 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cme"
site: "stable_cme"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/tag_group/vars/main.yml b/tests/integration/targets/tag_group/vars/main.yml
index 02a80145d..9e46f3e48 100644
--- a/tests/integration/targets/tag_group/vars/main.yml
+++ b/tests/integration/targets/tag_group/vars/main.yml
@@ -1,12 +1,12 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cme"
site: "stable_cme"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/timeperiod/vars/main.yml b/tests/integration/targets/timeperiod/vars/main.yml
index 6e82436cf..566913f02 100644
--- a/tests/integration/targets/timeperiod/vars/main.yml
+++ b/tests/integration/targets/timeperiod/vars/main.yml
@@ -1,9 +1,9 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
diff --git a/tests/integration/targets/user/tasks/test.yml b/tests/integration/targets/user/tasks/test.yml
index dac472c7e..041fdbe66 100644
--- a/tests/integration/targets/user/tasks/test.yml
+++ b/tests/integration/targets/user/tasks/test.yml
@@ -203,44 +203,6 @@
delegate_to: localhost
run_once: true # noqa run-once[task]
-- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Test create with short pw for 2.3 (should fail)"
- user: # noqa fqcn[action-core] # The FQCN lint makes no sense here, as we want to test our local module
- server_url: "{{ checkmk_var_server_url }}"
- site: "{{ outer_item.site }}"
- automation_user: "{{ checkmk_var_automation_user }}"
- automation_secret: "{{ checkmk_var_automation_secret }}"
- customer: "{{ (customer != None) | ternary(customer, omit) }}" # See PR #427
- name: "autotest"
- fullname: "autotest"
- auth_type: "automation"
- password: "2short"
- roles:
- - admin
- state: "present"
- delegate_to: localhost
- run_once: true # noqa run-once[task]
- when: "'2.3' in outer_item.version"
- register: checkmk_shortpwcheck_create
- failed_when: "'Please enter an automation secret of at least 10 characters.' not in checkmk_shortpwcheck_create.msg"
-
-- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Test reset with short pw for 2.3 (should fail)"
- user: # noqa fqcn[action-core] # The FQCN lint makes no sense here, as we want to test our local module
- server_url: "{{ checkmk_var_server_url }}"
- site: "{{ outer_item.site }}"
- automation_user: "{{ checkmk_var_automation_user }}"
- automation_secret: "{{ checkmk_var_automation_secret }}"
- customer: "{{ (customer != None) | ternary(customer, omit) }}" # See PR #427
- name: "{{ item.name }}"
- password: "{{ item.password }}"
- auth_type: "{{ item.auth_type }}"
- state: "reset_password"
- delegate_to: localhost
- run_once: true # noqa run-once[task]
- loop: "{{ checkmk_var_users_new_short_pw }}"
- when: "'2.3' in outer_item.version"
- register: checkmk_shortpwcheck_edit
- failed_when: "'Password too short. For 2.3 and higher' not in checkmk_shortpwcheck_edit.msg"
-
- name: "{{ outer_item.version }} - {{ outer_item.edition | upper }} - Delete users."
user: # noqa fqcn[action-core] # The FQCN lint makes no sense here, as we want to test our local module
server_url: "{{ checkmk_var_server_url }}"
diff --git a/tests/integration/targets/user/vars/main.yml b/tests/integration/targets/user/vars/main.yml
index 4bbd14f24..c3db47f91 100644
--- a/tests/integration/targets/user/vars/main.yml
+++ b/tests/integration/targets/user/vars/main.yml
@@ -1,12 +1,12 @@
---
test_sites:
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cme"
site: "stable_cme"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cee"
site: "stable_cee"
- - version: "2.3.0p4"
+ - version: "2.3.0p5"
edition: "cre"
site: "stable_cre"
- version: "2.2.0p27"
@@ -108,11 +108,6 @@ checkmk_var_users_newpw:
password: "abcdefghij"
auth_type: automation
-checkmk_var_users_new_short_pw:
- - name: user3
- password: "abcdefg"
- auth_type: password
-
checkmk_var_users_edit:
- name: admin1
fullname: Admin Eins