map_param now adds newlines to the lines it generates
Dieser Commit ist enthalten in:
Ursprung
ec82abe3d4
Commit
c3404200a9
|
@ -250,9 +250,9 @@ class SystemdUnitModule(AnsibleModule):
|
||||||
if self.params[param] is not None:
|
if self.params[param] is not None:
|
||||||
params = self.params[param]
|
params = self.params[param]
|
||||||
if isinstance(params, list):
|
if isinstance(params, list):
|
||||||
output.extend(("{}={}".format(key, p) for p in params))
|
output.extend(("{}={}\n".format(key, p) for p in params))
|
||||||
else:
|
else:
|
||||||
output.append("{}={}".format(key, self.params[param]))
|
output.append("{}={}\n".format(key, self.params[param]))
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def unitfile_gen(self):
|
def unitfile_gen(self):
|
||||||
|
|
|
@ -52,7 +52,7 @@ class Module(SystemdUnitModule): # type: ignore
|
||||||
type="Type",
|
type="Type",
|
||||||
kind="Kind",
|
kind="Kind",
|
||||||
)
|
)
|
||||||
return "[Match]\n" + "\n".join(options)
|
return "[Match]\n" + "".join(options)
|
||||||
|
|
||||||
def link(self) -> str:
|
def link(self) -> str:
|
||||||
options = []
|
options = []
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Module(SystemdUnitModule, SystemdReloadMixin): # type: ignore
|
||||||
|
|
||||||
def socket(self):
|
def socket(self):
|
||||||
section = "[Socket]\n"
|
section = "[Socket]\n"
|
||||||
section += "\n".join(
|
section += "".join(
|
||||||
self.map_param(
|
self.map_param(
|
||||||
stream="ListenStream",
|
stream="ListenStream",
|
||||||
datagram="ListenDatagram",
|
datagram="ListenDatagram",
|
||||||
|
|
|
@ -60,7 +60,7 @@ class Module(SystemdUnitModule, SystemdReloadMixin):
|
||||||
|
|
||||||
def service(self):
|
def service(self):
|
||||||
section = "[Service]\n"
|
section = "[Service]\n"
|
||||||
section += "\n".join(
|
section += "".join(
|
||||||
self.map_param(
|
self.map_param(
|
||||||
type="Type",
|
type="Type",
|
||||||
pre="ExecStartPre",
|
pre="ExecStartPre",
|
||||||
|
|
Laden…
In neuem Issue referenzieren