Skip to content
Snippets Groups Projects
Commit 4f369cc1 authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

exec 5.old.

parent 03ea38b3
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
# Should the config_dir be managed by us. # Should the config_dir be managed by us.
# @param mpd_conf # @param mpd_conf
# Settings passed along to mpd::conf # Settings passed along to mpd::conf
# @param service_name
# Name of the user (system) service
define mpd::user_instance ( define mpd::user_instance (
String $user = $name, String $user = $name,
String $group = $user, String $group = $user,
...@@ -30,6 +32,7 @@ define mpd::user_instance ( ...@@ -30,6 +32,7 @@ define mpd::user_instance (
String $config_file = "${config_dir}/mpd.conf", String $config_file = "${config_dir}/mpd.conf",
Boolean $manage_dir = true, Boolean $manage_dir = true,
Hash[String, Any] $mpd_conf = {}, Hash[String, Any] $mpd_conf = {},
String $service_name = 'mpd',
) { ) {
if $manage_dir { if $manage_dir {
file { $config_dir: file { $config_dir:
...@@ -51,14 +54,14 @@ define mpd::user_instance ( ...@@ -51,14 +54,14 @@ define mpd::user_instance (
} ~> Exec["Restart user ${user} mpd instance"] } ~> Exec["Restart user ${user} mpd instance"]
exec { "Enable user ${user} mpd instance": exec { "Enable user ${user} mpd instance":
command => 'systemctl enable --now --user mpd.service'.split(' '), command => "systemctl enable --now --user ${service_name}",
creates => "${xdg_config_home}/systemd/user/default.target.wants/mpd.service", creates => "${xdg_config_home}/systemd/user/default.target.wants/mpd.service",
user => $user, user => $user,
path => ['/bin', '/usr/bin'], path => ['/bin', '/usr/bin'],
} }
exec { "Restart user ${user} mpd instance": exec { "Restart user ${user} mpd instance":
command => 'systemctl restart --user mpd.service'.split(' '), command => "systemctl restart --user ${service_name}",
refreshonly => true, refreshonly => true,
path => ['/bin', '/usr/bin'], path => ['/bin', '/usr/bin'],
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment