summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-04-05 22:20:02 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-04-05 22:20:02 -0300
commitff606678e71b8f1ef3d8b602ad3c9ddfe5e31027 (patch)
tree3081dbb7ee195a49fa086cf2384ae90b2a6b4d1e /manifests
downloadpuppet-infinoted-ff606678e71b8f1ef3d8b602ad3c9ddfe5e31027.tar.gz
puppet-infinoted-ff606678e71b8f1ef3d8b602ad3c9ddfe5e31027.tar.bz2
Initial import
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp69
1 files changed, 69 insertions, 0 deletions
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'] ],
+ }
+}