ez_docker/plugins/module_utils/service/docker_in_docker.py
2024-12-12 18:03:49 +01:00

32 lines
759 B
Python

# Copyright: (c) 2024, Luca Bilke <luca@bil.ke>
# MIT License (see LICENSE)
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from ansible_collections.ssnailed.ez_compose.plugins.module_utils.service import ( # type: ignore[reportMissingTypeStubs]
common as service,
)
if TYPE_CHECKING:
from ansible_collections.ssnailed.ez_compose.plugins.module_utils.common import ( # type: ignore[reportMissingTypeStubs]
State,
)
EXTRA_ARGS = {
"command": {"type": "list"},
}
def helper(state: State, params: dict[str, Any]) -> State:
command = params.get("command")
update = {
"privileged": True,
}
if command:
update["command"] = command
return service.update(state, update)