Skip to content

Commit

Permalink
add sample puppet module for managing web-puppet
Browse files Browse the repository at this point in the history
  • Loading branch information
garethr committed Nov 6, 2011
1 parent 98d58c2 commit 91e0a7f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
8 changes: 8 additions & 0 deletions puppet/modules/web-puppet/files/web-puppet
@@ -0,0 +1,8 @@
description "start and stop web-puppet"
author "Gareth Rushgrove"

expect daemon

env RUBY_BIN=/opt/ruby/bin

exec $RUBY_BIN/web-puppet --config /etc/web-puppet.conf
32 changes: 32 additions & 0 deletions puppet/modules/web-puppet/manifests/init.pp
@@ -0,0 +1,32 @@
class webpuppet(
$port = '9295',
$username = nil,
$password = nil
) {

package { "web-puppet":
ensure => installed,
provider => gem,
}

file { "/etc/web-puppet.conf":
ensure => present,
content => template('web-puppet/web-puppet.conf'),
notify => Service['web-puppet'],
}

file { "/etc/init/web-puppet":
ensure => present,
source => "puppet:///modules/web-puppet/web-puppet",
}

service { "web-puppet":
ensure => running,
provider => upstart,
require => [
Package["web-puppet"],
File["/etc/init/web-puppet"],
]
}

}
3 changes: 3 additions & 0 deletions puppet/modules/web-puppet/templates/web-puppet.conf
@@ -0,0 +1,3 @@
port=<%= port %>
<% if username %>username=<%= username %><% end %>
<% if password %>password=<%= password %><% end %>

0 comments on commit 91e0a7f

Please sign in to comment.