added boolean handling
Dieser Commit ist enthalten in:
Ursprung
1c3d89e961
Commit
920da46658
|
@ -5,9 +5,9 @@ from typing import Any, Callable, ClassVar, Dict, NoReturn, Optional, Type, Type
|
|||
import ansible.module_utils.basic as basic
|
||||
|
||||
try:
|
||||
from ansible_collections.sebastian.systemd.plugins.module_utils.generic import AnsibleParameter, Types
|
||||
from ansible_collections.sebastian.systemd.plugins.module_utils.generic import AnsibleParameter, Types,systemdbool
|
||||
except ImportError:
|
||||
from plugins.module_utils.generic import AnsibleParameter, Types
|
||||
from plugins.module_utils.generic import AnsibleParameter, Types,systemdbool
|
||||
|
||||
|
||||
__all__ = (
|
||||
|
@ -230,7 +230,7 @@ class SystemdUnitModule(AnsibleModule):
|
|||
|
||||
def header(self) -> str:
|
||||
header = "[Unit]\n"
|
||||
header += "\n".join(
|
||||
header += "".join(
|
||||
self.map_param(
|
||||
description="Description",
|
||||
documentation="Documentation",
|
||||
|
@ -250,9 +250,9 @@ class SystemdUnitModule(AnsibleModule):
|
|||
if self.params[param] is not None:
|
||||
params = self.params[param]
|
||||
if isinstance(params, list):
|
||||
output.extend((f"{key}={p}\n" for p in params))
|
||||
output.extend((f"{key}={systemdbool(p)}\n" for p in params))
|
||||
else:
|
||||
output.append(f"{key}={self.params[param]}\n")
|
||||
output.append(f"{key}={systemdbool(params)}\n")
|
||||
return output
|
||||
|
||||
def unitfile_gen(self):
|
||||
|
|
Laden…
In neuem Issue referenzieren