24 lines
690 B
Python
24 lines
690 B
Python
# Copyright: (c) 2025, Luca Bilke <luca@bil.ke>
|
|
# MIT License (see LICENSE)
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING, Any, Callable
|
|
|
|
from ansible_collections.snailed.ez_compose.plugins.module_utils.service import common
|
|
|
|
if TYPE_CHECKING:
|
|
from ansible_collections.snailed.ez_compose.plugins.module_utils.models import State
|
|
|
|
|
|
BASE_ARGS: dict[str, Any] = {}
|
|
|
|
|
|
def run_helper(
|
|
state: State,
|
|
service_name: str,
|
|
params: dict[str, Any],
|
|
helper: Callable[[State, str, dict[str, Any]], dict[str, Any]] = lambda _a, _b, _c: {},
|
|
) -> State:
|
|
update = helper(state, service_name, params)
|
|
return common.apply_update(state, service_name, update)
|