From ff606678e71b8f1ef3d8b602ad3c9ddfe5e31027 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 5 Apr 2013 22:20:02 -0300 Subject: Initial import --- manifests/init.pp | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 manifests/init.pp (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..8a24889 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,69 @@ +# 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 = hiera('infinoted::password', '') +) { + 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'], + } + + exec { 'infinoted-gen-keys': + command => 'infinoted --create-key --create-certificate -k /var/lib/infinoted/.certs/cert.key -c /var/lib/infinoted/.certs/cert.cert &', + creates => '/var/lib/infinoted/.certs/cert.key', + require => '/var/lib/infinoted/.config/infinoted.conf', + } + + supervisor::app { 'infinoted': + source => [ 'puppet:///modules/site_infinoted/conf.d/infinoted.conf', + 'puppet:///modules/infinoted/conf.d/infinoted.conf' ], + require => [ File['/var/lib/infinoted/.config/infinoted.conf'], Exec['infinoted-gen-keys'] ], + } +} -- cgit v1.2.3