mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Add .service extension to systemd files (#310)
This commit is contained in:
parent
b2541ad39c
commit
3f3cdab506
4 changed files with 19 additions and 6 deletions
|
|
@ -69,9 +69,10 @@ def generate_systemd(module, module_params, name):
|
|||
module.fail_json("Path %s is not a directory! "
|
||||
"Can not save systemd unit files there!"
|
||||
% sysconf['path'])
|
||||
for k, v in data.items():
|
||||
with open(os.path.join(sysconf['path'], k), 'w') as f:
|
||||
f.write(v)
|
||||
for file_name, file_content in data.items():
|
||||
file_name += ".service"
|
||||
with open(os.path.join(sysconf['path'], file_name), 'w') as f:
|
||||
f.write(file_content)
|
||||
return data
|
||||
except Exception as e:
|
||||
module.log(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue