diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 15 | ||||
-rw-r--r-- | manifests/setup.pp | 33 |
2 files changed, 48 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..f34cb24 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,15 @@ +#IPTABLES RULES +# /sbin/iptables -I INPUT -p tcp --dport 3689 -j ACCEPT +# /sbin/iptables -I INPUT -p udp --dport 3689 -j ACCEPT +# Firewall fixup + +class daap_server($collection_name = 'DAAP Music', $music_dir = '/srv/music' ) { + if $::osfamily == 'RedHat' { + class { 'daap_server::setup': + music_dir => $music_dir, + collection_name => $collection_name, + } + } else { + notice("Your operating system $::operatingsystem is not supported with this module (daap_server)") + } +} diff --git a/manifests/setup.pp b/manifests/setup.pp new file mode 100644 index 0000000..457a84d --- /dev/null +++ b/manifests/setup.pp @@ -0,0 +1,33 @@ +# Puppet manifest for setting up my mt-daapd server +class daap_server::setup($music_dir = '/srv/music', $collection_name = 'Secondary DAAP Server') { + include 'avahi' + + package { 'mt-daapd': + ensure => latest, + require => Service['avahi_dbus'], + } + + file { '/etc/mt-daapd.conf': + ensure => present, + content => template('daap_server/mt-daapd.conf.erb'), + owner => 'root', + mode => '640', + require => Package['mt-daapd'], + notify => Service['mt-daapd'] + } + + service { 'mt-daapd': + ensure => running, + enable => true, + hasrestart => true, + require => [ File['/etc/mt-daapd.conf'], Package['mt-daapd'], Exec["mkdir $music_dir"] ] + } + + exec { "mkdir $music_dir": + path => [ '/usr/bin', '/bin' ], + command => "mkdir -p $music_dir", + unless => "[ -d $music_dir ]", + notify => Service['mt-daapd'], + require => Service['avahi_dbus'] + } +} |