summaryrefslogtreecommitdiff
path: root/manifests/all.pp
blob: 5c26afee3fa2653dd9c6ffa8e709b80b8a69f3cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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 were running 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/mpd/default.pa" ],
  }
}