Skip to content

Commit

Permalink
Make site module 2.4.0 ready.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgetwan committed Jan 24, 2025
1 parent 76bf15a commit 303219a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions plugins/doc_fragments/site_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ class ModuleDocFragment(object):
- files below C($OMD_ROOT/local/) on the remote site will be removed.
type: bool
default: true
message_broker_port:
description:
- The port used by the message broker to exchange messages.
type: int
basic_settings:
description:
- A site's basic settings.
Expand Down
3 changes: 3 additions & 0 deletions plugins/module_utils/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ def get_api_data(self, target_api):
default=True,
type="bool",
),
message_broker_port=dict(
type="int",
),
),
),
basic_settings=dict(
Expand Down
19 changes: 18 additions & 1 deletion plugins/modules/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,24 @@ def delete(self, site_connection):
def _verify_compatibility(self):
if self.getversion() <= CheckmkVersion("2.2.0"):
exit_module(
msg="Site management is only available for Checkmk versions starting with 2.2.0.",
self.module,
msg="Site management is only available for Checkmk versions starting with 2.2.0. Version found: %s"
% self.getversion(),
failed=True,
)

message_broker_port = (
self.params.get("site_connection", {})
.get("site_config", {})
.get("configuration_connection", {})
.get("message_broker_port")
)

if self.getversion() < CheckmkVersion("2.4.0i1") and message_broker_port:
exit_module(
self.module,
msg="The parameter message_broker_port is only available for Checkmk versions starting with 2.4.0. Version found: %s"
% self.getversion(),
failed=True,
)

Expand Down

0 comments on commit 303219a

Please sign in to comment.