Closed supun983 closed 3 months ago
Have you try
systemd::manage_unit { 'myrunner.service':
unit_entry => {
'Description' => 'My great service',
},
service_entry => {
'Type' => 'oneshot',
'ExecStart' => '/usr/bin/doit.sh',
'NetworkNamespacePath' => '/path/to/',
},
install_entry => {
'WantedBy' => 'multi-user.target',
},
enable => true,
active => true,
}
Have you try
systemd::manage_unit { 'myrunner.service': unit_entry => { 'Description' => 'My great service', }, service_entry => { 'Type' => 'oneshot', 'ExecStart' => '/usr/bin/doit.sh', 'NetworkNamespacePath' => '/path/to/', }, install_entry => { 'WantedBy' => 'multi-user.target', }, enable => true, active => true, }
Yes, I tried like this. However, getting Evaluation Error
as unrecognized key NetworkNamespacePath
. To resolve it, need to define a key in Systemd::Unit::Service
as Optional['NetworkNamespacePath'] => Variant[Stdlib::Unixpath,Array[Stdlib::Unixpath,1]]
.
Ok I see let me try.
Ok, I've set it as stdlib::unixpath instead of variant
Could you please check of adding NetworkNamespacePath key for the service section of a unit file(types/unit/service)
systemd ref: https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#NetworkNamespacePath=