aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-08-03 09:27:33 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-08-03 09:27:33 -0300
commit8c0462d71b64e61c7b0838dd662c2ada8ccc8c47 (patch)
treea6d3c8a488d7320827ec16cf5aeb0b9e0c981cc0 /manifests
parentc87108f0b5fcb2834747c2a167ab2cb4a278dc17 (diff)
downloadpuppet-icecast-8c0462d71b64e61c7b0838dd662c2ada8ccc8c47.tar.gz
puppet-icecast-8c0462d71b64e61c7b0838dd662c2ada8ccc8c47.tar.bz2
Adds main class
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp32
1 files changed, 31 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index c0209c7..02b23af 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,2 +1,32 @@
-class icecast {
+class icecast(
+ $config_content = hiera('icecast::config_content', false),
+ $config_source = [ "puppet:///modules/site_icecast/${::hostname}.conf",
+ "puppet:///modules/icecast/icecast.conf" ],
+) {
+ package { 'icecast2':
+ ensure => present,
+ }
+
+ file { '/etc/icecast2/icecast.xml':
+ ensure => present,
+ owner => 'icecast2',
+ group => 'icecast',
+ mode => '0660',
+ require => Package['icecast2'],
+ notify => Service['icecast2'],
+ }
+
+ service { 'icecast2':
+ ensure => running,
+ }
+
+ if $config_content {
+ File['/etc/icecast2/icecast.xml']{
+ content => $config_content,
+ }
+ } else {
+ File['/etc/icecast2/icecast.xml']{
+ source => $config_source,
+ }
+ }
}