31 lines
838 B
Python
31 lines
838 B
Python
# Copyright: (c) 2024, Luca Bilke <luca@bil.ke>
|
|
# MIT License (see LICENSE)
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING, Any
|
|
|
|
import ansible_collections.ssnailed.ez_compose.plugins.module_utils.service.common as service # type: ignore[reportMissingTypeStubs]
|
|
|
|
if TYPE_CHECKING:
|
|
from ansible_collections.ssnailed.ez_compose.plugins.module_utils.common import ( # type: ignore[reportMissingTypeStubs]
|
|
State,
|
|
)
|
|
|
|
EXTRA_ARGS = {
|
|
"stop": {"type": "bool"},
|
|
}
|
|
|
|
|
|
def helper(state: State) -> State:
|
|
stop = state.module.params.get("stop", True)
|
|
project_name = state.module.params["project_name"]
|
|
|
|
update: dict[str, Any] = {}
|
|
|
|
if stop:
|
|
update["labels"] = {
|
|
"docker-volume-backup.stop-during-backup": project_name,
|
|
}
|
|
|
|
return service.update(state, update)
|