summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2012-11-20 16:24:38 -0500
committerMicah Anderson <micah@riseup.net>2012-11-20 21:30:37 -0500
commit515ca5ce0d19ac29fff6397c7b146ddabc123f05 (patch)
tree98ed0bf47b8a34461656f357d816294452d34cd7
parentddd6fd82cc9e81d7ff912e390d956d6b2d958d8d (diff)
add initial site_webapp module
-rw-r--r--puppet/modules/site_webapp/manifests/init.pp50
1 files changed, 50 insertions, 0 deletions
diff --git a/puppet/modules/site_webapp/manifests/init.pp b/puppet/modules/site_webapp/manifests/init.pp
new file mode 100644
index 00000000..107aa617
--- /dev/null
+++ b/puppet/modules/site_webapp/manifests/init.pp
@@ -0,0 +1,50 @@
+class site_webapp {
+
+ Class[Ruby] -> Class[rubygems] -> Class[bundler::install]
+
+ class { 'ruby': ruby_version => '1.9.3' }
+
+ include rubygems
+
+ class { 'bundler::install': install_method => '' }
+
+ group { 'leap-webapp':
+ ensure => present,
+ allowdupe => false;
+ }
+
+ user { 'leap-webapp':
+ ensure => present,
+ allowdupe => false,
+ gid => 'leap-webapp',
+ home => '/srv/leap-webapp',
+ require => [ Group['leap-webapp'] ];
+ }
+
+ file { '/srv/leap-webapp':
+ ensure => present,
+ owner => 'leap-webapp',
+ group => 'leap-webapp',
+ require => User['leap-webapp'];
+ }
+
+ vcsrepo { '/srv/leap-webapp':
+ ensure => present,
+ revision => 'master',
+ provider => git,
+ source => 'git://code.leap.se/leap_web',
+ owner => 'leap-webapp',
+ group => 'leap-webapp',
+ require => [ User['leap-webapp'], Group['leap-webapp'] ],
+ notify => Exec['bundler_update']
+ }
+
+ exec { 'bundler_update':
+ cwd => '/srv/leap-webapp',
+ command => '/bin/bash -c \"/usr/bin/bundle check || /usr/bin/bundle install\"',
+ unless => '/usr/bin/bundle check',
+ require => [ Class['bundler::install'], Vcsrepo['/srv/leap-webapp'] ];
+ }
+}
+
+