class mpd::all { include mpd include mpd::client user { 'mpd': ensure => present, home => '/var/lib/mpd', shell => '/bin/false', gid => 'audio', groups => [ 'audio', 'pulse', 'pulse-access' ], } # In the past we ensured pulseaudio ran systemwide # so both mpd and users can share audio control. # # This could be managed elsewhere. file { '/etc/default/pulseaudio': ensure => present, owner => root, group => root, mode => '0644', notify => Service['mpd'], source => [ "puppet:///modules/mpd/pulseaudio" ], } # When run as its own user as per the wiki instructions, mpd will be unable to # send sound to another user's pulseaudio server. Rather than setting up # pulseaudio as a system-wide daemon, a practice strongly discouraged by # upstream, you can instead configure mpd to use pulseaudio's tcp module to send # sound to localhost. # # See https://wiki.archlinux.org/index.php/Music_Player_Daemon/Tips_and_tricks#Local_.28with_separate_mpd_user.29 file { '/etc/pulse/default.pa': ensure => present, owner => root, group => root, mode => '0644', notify => Service['mpd'], source => [ "puppet:///modules/site_mpd/default-${::hostname}.pa", "puppet:///modules/site_mpd/default.pa", "puppet:///modules/mpd/default.pa", ], } }