#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2024, Luca Bilke <luca@bil.ke> # MIT License (see LICENSE) # TODO: write ansible sections DOCUMENTATION = r""" """ EXAMPLES = r""" """ RETURN = r""" """ from __future__ import annotations # pyright: ignore[reportGeneralTypeIssues] from typing import Any from ansible_collections.snailed.ez_compose.plugins.module_utils.common import ( State, run_label, update_service, ) 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 update_service(state, update) def main(): extra_args = { "stop": {"type": "bool"}, } run_label(extra_args, helper) if __name__ == "__main__": main()