]> gitweb.fluxo.info Git - puppet-icecast.git/commitdiff
Adds main class
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 3 Aug 2019 12:27:33 +0000 (09:27 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 3 Aug 2019 12:27:33 +0000 (09:27 -0300)
manifests/init.pp

index c0209c7f0bf32b6ad798e8ce4ec07ec842396db5..02b23af932bba6335a196569418e8a4af17b083f 100644 (file)
@@ -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,
+    }
+  }
 }