# https://wiki.koumbit.net/ObbyServer # http://gobby.0x539.de/trac/wiki/Infinote/Infinoted # http://www.webupd8.org/2011/04/how-to-set-up-and-use-gedit.html class infinoted( $password = lookup('infinoted::password', undef, undef, '') ) { include avahi case $password { '': { fail("You need to define infinoted password! Please set infinoted::password in your config") } } package { 'infinoted': ensure => installed, } group { "infinoted": ensure => present, allowdupe => false, } user { "infinoted": ensure => present, allowdupe => false, gid => 'infinoted', home => '/var/lib/infinoted', require => Group['infinoted'], shell => '/bin/false', } file { '/var/lib/infinoted': ensure => directory, owner => 'infinoted', group => 'infinoted', mode => '0750', require => User['infinoted'], } file { [ '/var/lib/infinoted/.config', '/var/lib/infinoted/.infinoted', '/var/lib/infinoted/.certs', '/var/lib/infinoted/data', '/var/lib/infinoted/export' ]: ensure => directory, owner => 'infinoted', group => 'infinoted', mode => '0750', require => File['/var/lib/infinoted'], } file { '/var/lib/infinoted/.config/infinoted.conf': ensure => present, owner => 'infinoted', group => 'infinoted', mode => '0640', content => template('infinoted/infinoted.conf.erb'), require => File['/var/lib/infinoted/.config'], } # Generate keys # This exec will launch the server but not daemonize, so we fork it to the background exec { 'infinoted-gen-keys': command => '/usr/bin/infinoted --create-key --create-certificate -k /var/lib/infinoted/.certs/infinoted.key -c /var/lib/infinoted/.certs/infinoted.cert &', creates => '/var/lib/infinoted/.certs/infinoted.key', require => File['/var/lib/infinoted/.config/infinoted.conf'], } supervisor::app { 'infinoted': source => [ 'puppet:///modules/site_infinoted/infinoted.conf', 'puppet:///modules/infinoted/infinoted.conf' ], require => [ File['/var/lib/infinoted/.config/infinoted.conf'], Exec['infinoted-gen-keys'] ], } file { '/etc/avahi/services/infinoted.service': ensure => present, owner => root, group => root, mode => '0644', source => 'puppet:///modules/infinoted/infinoted.service', notify => Service['avahi-daemon'], } }