summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-12-29 21:33:34 -0200
committerSilvio Rhatto <rhatto@riseup.net>2018-12-29 21:33:34 -0200
commitb0bf1a0a9507bad52d1a5f5c2a0afb7ce61d6170 (patch)
treebd528133f5c3771dad4017c05cb3c3712866f4a5 /manifests
parenta4458293672f3f3f34c21870d929d0bf26aa5ed4 (diff)
downloadpuppet-cherrymusic-b0bf1a0a9507bad52d1a5f5c2a0afb7ce61d6170.tar.gz
puppet-cherrymusic-b0bf1a0a9507bad52d1a5f5c2a0afb7ce61d6170.tar.bz2
Working setup
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp88
1 files changed, 88 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index d8465f2..e5e8f35 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,2 +1,90 @@
class cherrymusic {
+ package { [
+ 'python3-cherrypy3',
+ 'lame',
+ ]:
+ ensure => present,
+ }
+
+ group { "cherrymusic":
+ ensure => present,
+ allowdupe => false,
+ }
+
+ user { "cherrymusic":
+ ensure => present,
+ allowdupe => false,
+ shell => '/bin/false',
+ gid => 'cherrymusic',
+ home => '/var/lib/cherrymusic',
+ require => Group['cherrymusic'],
+ }
+
+ file { [
+ '/var/lib/cherrymusic',
+ '/var/lib/cherrymusic/.config',
+ '/var/lib/cherrymusic/.config/cherrymusic',
+ ]:
+ ensure => directory,
+ owner => 'cherrymusic',
+ group => 'cherrymusic',
+ mode => '0750',
+ require => User['cherrymusic'],
+ }
+
+ file { '/var/lib/cherrymusic/.config/cherrymusic/cherrymusic.conf':
+ ensure => present,
+ owner => 'cherrymusic',
+ group => 'cherrymusic',
+ mode => '0644',
+ source => [
+ 'puppet:///modules/site_cherrymusic/cherrymusic.conf',
+ 'puppet:///modules/cherrymusic/cherrymusic.conf',
+ ],
+ require => File['/var/lib/cherrymusic/.config/cherrymusic'],
+ }
+
+ file { '/etc/systemd/system/cherrymusic@.service':
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => '0644',
+ source => 'puppet:///modules/cherrymusic/cherrymusic@.service',
+ notify => Exec['systemctl-enable-cherrymusic'],
+ }
+
+ exec { 'systemctl-enable-cherrymusic':
+ command => '/bin/systemctl daemon-reload && /bin/systemctl enable cherrymusic@cherrymusic',
+ require => File['/etc/systemd/system/cherrymusic@.service'],
+ user => root,
+ refreshonly => true,
+ }
+
+ #file { '/usr/local/bin/cherrymusic':
+ # ensure => present,
+ # owner => root,
+ # group => root,
+ # mode => '0755',
+ # content => "/usr/bin/python3 /usr/local/share/cherrymusic/cherrymusic\n"
+ #}
+
+ vcsrepo { '/usr/local/share/cherrymusic':
+ ensure => present,
+ owner => root,
+ group => root,
+ user => root,
+ provider => git,
+ source => 'https://github.com/devsnd/cherrymusic',
+ revision => '911b757b6e3a59d3be5fded9e7ab08b0807959fa',
+ }
+
+ service { 'cherrymusic@cherrymusic':
+ ensure => running,
+ enable => true,
+ require => [
+ File['/var/lib/cherrymusic/.config/cherrymusic/cherrymusic.conf', '/etc/systemd/system/cherrymusic@.service', ], # '/usr/local/bin/cherrymusic'],
+ Vcsrepo['/usr/local/share/cherrymusic'],
+ Exec['systemctl-enable-cherrymusic'],
+ ],
+ }
}