summaryrefslogtreecommitdiff
path: root/puppet/modules/site_static/manifests
diff options
context:
space:
mode:
authorMicah <micah@leap.se>2016-05-10 14:48:26 -0400
committerMicah <micah@leap.se>2016-05-10 14:48:26 -0400
commit86c85582065c391aa13c0b9b397dfd1aa2e2ac7b (patch)
tree7c027409a517d862864bf3650f4a8a66f615162d /puppet/modules/site_static/manifests
parent70b1c648b94e6c007b9241a4661f33881e74485f (diff)
parent66b4c6b5ec6fe2f242020845fe92715ae2cdcc1e (diff)
Merge tag '0.8.0'
Release 0.8.0
Diffstat (limited to 'puppet/modules/site_static/manifests')
-rw-r--r--puppet/modules/site_static/manifests/domain.pp17
-rw-r--r--puppet/modules/site_static/manifests/init.pp31
-rw-r--r--puppet/modules/site_static/manifests/location.pp9
3 files changed, 34 insertions, 23 deletions
diff --git a/puppet/modules/site_static/manifests/domain.pp b/puppet/modules/site_static/manifests/domain.pp
index b9177f25..b26cc9e3 100644
--- a/puppet/modules/site_static/manifests/domain.pp
+++ b/puppet/modules/site_static/manifests/domain.pp
@@ -1,3 +1,4 @@
+# configure static service for domain
define site_static::domain (
$ca_cert,
$key,
@@ -10,19 +11,19 @@ define site_static::domain (
$domain = $name
$base_dir = '/srv/static'
- create_resources(site_static::location, $locations)
+ $cafile = "${cert}\n${ca_cert}"
+
+ if is_hash($locations) {
+ create_resources(site_static::location, $locations)
+ }
x509::cert { $domain:
- content => $cert,
- notify => Service[apache]
+ content => $cafile,
+ notify => Service[apache]
}
x509::key { $domain:
content => $key,
- notify => Service[apache]
- }
- x509::ca { "${domain}_ca":
- content => $ca_cert,
- notify => Service[apache]
+ notify => Service[apache]
}
apache::vhost::file { $domain:
diff --git a/puppet/modules/site_static/manifests/init.pp b/puppet/modules/site_static/manifests/init.pp
index 1efc510b..4a722d62 100644
--- a/puppet/modules/site_static/manifests/init.pp
+++ b/puppet/modules/site_static/manifests/init.pp
@@ -1,6 +1,8 @@
+# deploy static service
class site_static {
tag 'leap_service'
+ include site_config::default
include site_config::x509::cert
include site_config::x509::key
include site_config::x509::ca_bundle
@@ -9,6 +11,7 @@ class site_static {
$domains = $static['domains']
$formats = $static['formats']
$bootstrap = $static['bootstrap_files']
+ $tor = hiera('tor', false)
if $bootstrap['enabled'] {
$bootstrap_domain = $bootstrap['domain']
@@ -27,14 +30,13 @@ class site_static {
}
}
- class { '::apache': no_default_site => true, ssl => true }
- include site_apache::module::headers
- include site_apache::module::alias
- include site_apache::module::expires
- include site_apache::module::removeip
- include site_apache::module::rewrite
- apache::config::include{ 'ssl_common.inc': }
-
+ include apache::module::headers
+ include apache::module::alias
+ include apache::module::expires
+ include apache::module::removeip
+ include apache::module::dir
+ include apache::module::negotiation
+ include site_apache::common
include site_config::ruby::dev
if (member($formats, 'rack')) {
@@ -46,9 +48,9 @@ class site_static {
}
if (member($formats, 'amber')) {
- rubygems::gem{'amber-0.3.7':
- require => Package['zlib1g-dev']
- }
+ rubygems::gem{'amber-0.3.8':
+ require => Package['zlib1g-dev']
+ }
package { 'zlib1g-dev':
ensure => installed
@@ -57,6 +59,13 @@ class site_static {
create_resources(site_static::domain, $domains)
+ if $tor {
+ $hidden_service = $tor['hidden_service']
+ if $hidden_service['active'] {
+ include site_webapp::hidden_service
+ }
+ }
+
include site_shorewall::defaults
include site_shorewall::service::http
include site_shorewall::service::https
diff --git a/puppet/modules/site_static/manifests/location.pp b/puppet/modules/site_static/manifests/location.pp
index ce2af9af..d116de2f 100644
--- a/puppet/modules/site_static/manifests/location.pp
+++ b/puppet/modules/site_static/manifests/location.pp
@@ -1,3 +1,4 @@
+# configure static service for location
define site_static::location($path, $format, $source) {
$file_path = "/srv/static/${name}"
@@ -14,10 +15,10 @@ define site_static::location($path, $format, $source) {
if ($format == 'amber') {
exec {"amber_build_${name}":
- cwd => $file_path,
- command => 'amber rebuild',
- user => 'www-data',
- timeout => 600,
+ cwd => $file_path,
+ command => 'amber rebuild',
+ user => 'www-data',
+ timeout => 600,
subscribe => Vcsrepo[$file_path]
}
}