added modspec as an helper function.
it has the typedefinition that allows the developer to get the required parameters for ansible modules more easily
Dieser Commit ist enthalten in:
Ursprung
a2174af565
Commit
652b7e961d
|
@ -102,3 +102,21 @@ def systemdbool(b: Union[bool, str]) -> str:
|
|||
elif b is False:
|
||||
return "no"
|
||||
return b
|
||||
|
||||
|
||||
def modspec(
|
||||
argument_spec: Dict[str, Dict[str, Any]],
|
||||
mutually_exclusive: Sequence[Tuple[str, ...]] = (),
|
||||
required_together: Sequence[Tuple[str, ...]] = (),
|
||||
required_one_of: Sequence[Tuple[str, ...]] = (),
|
||||
required_if: Sequence[Union[Tuple[str, Any, Tuple[str, ...]], Tuple[str, Any, Tuple[str, ...], bool]]] = (),
|
||||
required_by: Dict[str, Union[str, Tuple[str, ...]]] = {},
|
||||
) -> Dict[str, Any]:
|
||||
return dict(
|
||||
argument_spec=argument_spec,
|
||||
mutually_exclusive=mutually_exclusive,
|
||||
required_together=required_together,
|
||||
required_one_of=required_one_of,
|
||||
required_if=required_if,
|
||||
required_by=required_by,
|
||||
)
|
||||
|
|
Laden…
In neuem Issue referenzieren