summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--puppet/modules/site_apache/templates/vhosts.d/api.conf.erb2
-rw-r--r--puppet/modules/site_apache/templates/vhosts.d/leap_webapp.conf.erb2
-rw-r--r--puppet/modules/site_config/manifests/default.pp3
-rw-r--r--puppet/modules/site_webapp/files/migrate_design_documents2
-rw-r--r--puppet/modules/site_webapp/manifests/couchdb.pp8
-rw-r--r--puppet/modules/site_webapp/manifests/init.pp36
-rw-r--r--puppet/modules/try/manifests/file.pp13
7 files changed, 41 insertions, 25 deletions
diff --git a/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb b/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb
index 20d3dc9a..ae894cd4 100644
--- a/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb
+++ b/puppet/modules/site_apache/templates/vhosts.d/api.conf.erb
@@ -21,7 +21,7 @@ Listen 0.0.0.0:<%= api_port %>
RequestHeader set X_FORWARDED_PROTO 'https'
- DocumentRoot /srv/leap-webapp/public
+ DocumentRoot /srv/leap/webapp/public
# Check for maintenance file and redirect all requests
RewriteEngine On
diff --git a/puppet/modules/site_apache/templates/vhosts.d/leap_webapp.conf.erb b/puppet/modules/site_apache/templates/vhosts.d/leap_webapp.conf.erb
index 2ccc4418..3055a7bb 100644
--- a/puppet/modules/site_apache/templates/vhosts.d/leap_webapp.conf.erb
+++ b/puppet/modules/site_apache/templates/vhosts.d/leap_webapp.conf.erb
@@ -21,7 +21,7 @@
RequestHeader set X_FORWARDED_PROTO 'https'
- DocumentRoot /srv/leap-webapp/public
+ DocumentRoot /srv/leap/webapp/public
RewriteEngine On
# Check for maintenance file and redirect all requests
diff --git a/puppet/modules/site_config/manifests/default.pp b/puppet/modules/site_config/manifests/default.pp
index 77241df5..7758a69d 100644
--- a/puppet/modules/site_config/manifests/default.pp
+++ b/puppet/modules/site_config/manifests/default.pp
@@ -33,4 +33,7 @@ class site_config::default {
# include basic shorewall config
include site_shorewall::defaults
+
+ Class['git'] -> Vcsrepo<||>
+
}
diff --git a/puppet/modules/site_webapp/files/migrate_design_documents b/puppet/modules/site_webapp/files/migrate_design_documents
index 88eb2e25..6e24aa5b 100644
--- a/puppet/modules/site_webapp/files/migrate_design_documents
+++ b/puppet/modules/site_webapp/files/migrate_design_documents
@@ -1,6 +1,6 @@
#!/bin/sh
-cd /srv/leap-webapp
+cd /srv/leap/webapp
# use admin credentials
cp config/couchdb.yml.admin config/couchdb.yml
diff --git a/puppet/modules/site_webapp/manifests/couchdb.pp b/puppet/modules/site_webapp/manifests/couchdb.pp
index 7858dbfd..b4ef0980 100644
--- a/puppet/modules/site_webapp/manifests/couchdb.pp
+++ b/puppet/modules/site_webapp/manifests/couchdb.pp
@@ -25,21 +25,21 @@ class site_webapp::couchdb {
$key_path = "${x509::variables::keys}/${cert_name}.key"
file {
- '/srv/leap-webapp/config/couchdb.yml.admin':
+ '/srv/leap/webapp/config/couchdb.yml.admin':
content => template('site_webapp/couchdb.yml.admin.erb'),
owner => leap-webapp,
group => leap-webapp,
mode => '0600',
require => Vcsrepo['/srv/leap/webapp'];
- '/srv/leap-webapp/config/couchdb.yml.webapp':
+ '/srv/leap/webapp/config/couchdb.yml.webapp':
content => template('site_webapp/couchdb.yml.erb'),
owner => leap-webapp,
group => leap-webapp,
mode => '0600',
require => Vcsrepo['/srv/leap/webapp'];
- '/srv/leap-webapp/logs/production.log':
+ '/srv/leap/webapp/logs/production.log':
owner => leap-webapp,
group => leap-webapp,
mode => '0666',
@@ -61,7 +61,7 @@ class site_webapp::couchdb {
}
exec { 'migrate_design_documents':
- cwd => '/srv/leap-webapp',
+ cwd => '/srv/leap/webapp',
command => '/usr/local/sbin/migrate_design_documents',
require => Exec['bundler_update'],
notify => Service['apache'];
diff --git a/puppet/modules/site_webapp/manifests/init.pp b/puppet/modules/site_webapp/manifests/init.pp
index 92cf4b25..1dfe6936 100644
--- a/puppet/modules/site_webapp/manifests/init.pp
+++ b/puppet/modules/site_webapp/manifests/init.pp
@@ -27,19 +27,20 @@ class site_webapp {
allowdupe => false,
gid => 'leap-webapp',
groups => 'ssl-cert',
- home => '/srv/leap-webapp',
+ home => '/srv/leap/webapp',
require => [ Group['leap-webapp'] ];
}
- file { '/srv/leap-webapp':
+ file { '/srv/leap/webapp':
ensure => directory,
owner => 'leap-webapp',
group => 'leap-webapp',
require => User['leap-webapp'];
}
- vcsrepo { '/srv/leap-webapp':
+ vcsrepo { '/srv/leap/webapp':
ensure => present,
+ force => true,
revision => 'origin/master',
provider => git,
source => 'git://code.leap.se/leap_web',
@@ -50,17 +51,17 @@ class site_webapp {
}
exec { 'bundler_update':
- cwd => '/srv/leap-webapp',
+ cwd => '/srv/leap/webapp',
command => '/bin/bash -c "/usr/bin/bundle check || /usr/bin/bundle install --path vendor/bundle"',
unless => '/usr/bin/bundle check',
user => 'leap-webapp',
timeout => 600,
- require => [ Class['bundler::install'], Vcsrepo['/srv/leap-webapp'] ],
+ require => [ Class['bundler::install'], Vcsrepo['/srv/leap/webapp'] ],
notify => Service['apache'];
}
exec { 'compile_assets':
- cwd => '/srv/leap-webapp',
+ cwd => '/srv/leap/webapp',
command => '/bin/bash -c "/usr/bin/bundle exec rake assets:precompile"',
user => 'leap-webapp',
require => Exec['bundler_update'],
@@ -68,46 +69,47 @@ class site_webapp {
}
file {
- '/srv/leap-webapp/public/provider.json':
+ '/srv/leap/webapp/public/provider.json':
content => $provider,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0644';
- '/srv/leap-webapp/public/ca.crt':
+ '/srv/leap/webapp/public/ca.crt':
ensure => link,
require => Vcsrepo['/srv/leap/webapp'],
target => '/usr/local/share/ca-certificates/leap_api.crt';
- "/srv/leap-webapp/public/${api_version}":
+ "/srv/leap/webapp/public/${api_version}":
ensure => directory,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0755';
- "/srv/leap-webapp/public/${api_version}/config/":
+ "/srv/leap/webapp/public/${api_version}/config/":
ensure => directory,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0755';
- "/srv/leap-webapp/public/${api_version}/config/eip-service.json":
+ "/srv/leap/webapp/public/${api_version}/config/eip-service.json":
content => $eip_service,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0644';
- "/srv/leap-webapp/public/${api_version}/config/soledad-service.json":
+ "/srv/leap/webapp/public/${api_version}/config/soledad-service.json":
content => $soledad_service,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0644';
- "/srv/leap-webapp/public/${api_version}/config/smtp-service.json":
+ "/srv/leap/webapp/public/${api_version}/config/smtp-service.json":
content => $smtp_service,
require => Vcsrepo['/srv/leap/webapp'],
owner => leap-webapp, group => leap-webapp, mode => '0644';
}
try::file {
- '/srv/leap-webapp/public/favicon.ico':
- ensure => 'link',
- target => $webapp['favicon'];
+ '/srv/leap/webapp/public/favicon.ico':
+ ensure => 'link',
+ require => Vcsrepo['/srv/leap/webapp'],
+ target => $webapp['favicon'];
'/srv/leap/webapp/app/assets/stylesheets/tail.scss':
ensure => 'link',
@@ -126,7 +128,7 @@ class site_webapp {
}
file {
- '/srv/leap-webapp/config/config.yml':
+ '/srv/leap/webapp/config/config.yml':
content => template('site_webapp/config.yml.erb'),
owner => leap-webapp,
group => leap-webapp,
diff --git a/puppet/modules/try/manifests/file.pp b/puppet/modules/try/manifests/file.pp
index 406c0b7a..47a8c269 100644
--- a/puppet/modules/try/manifests/file.pp
+++ b/puppet/modules/try/manifests/file.pp
@@ -18,7 +18,10 @@ define try::file (
file { "$name":
ensure => $ensure,
target => $target,
- require => Exec["check_${name}"],
+ require => $require ? {
+ undef => Exec["check_${name}"],
+ default => [ $require, Exec["check_${name}"] ]
+ },
loglevel => info;
}
}
@@ -37,6 +40,10 @@ define try::file (
exec { "restore_${name}":
command => $command,
cwd => $file_dirname,
+ require => $require ? {
+ undef => undef,
+ default => [ $require ]
+ },
loglevel => info;
}
} else {
@@ -44,6 +51,10 @@ define try::file (
unless => "/usr/bin/test -e '${target}'",
command => $command,
cwd => $file_dirname,
+ require => $require ? {
+ undef => undef,
+ default => [ $require ]
+ },
loglevel => info;
}
}