]> WPIA git - infra.git/blobdiff - environments/production/manifests/nginx.pp
fix: correctly auto-start cassiopeia services
[infra.git] / environments / production / manifests / nginx.pp
index 4bb0e97dcc0d9b5f7ccff80450217f8980b861eb..db81cc5177f00fec1db11c766e6c856856956e5d 100644 (file)
@@ -1,4 +1,4 @@
-define front_vhost($source, $crt = undefined){
+define front_vhost($source, $crt = undefined, $args = {}){
   if $crt {
     file{"/etc/ssl/private/$name.crt":
       ensure => 'file',
@@ -16,7 +16,7 @@ define front_vhost($source, $crt = undefined){
   }
   file {"/etc/nginx/sites-available/$name.conf":
     ensure => 'file',
-    content => epp($source),
+    content => epp($source, $args),
     require => Package['nginx-light'],
   }->
   file {"/etc/nginx/sites-enabled/$name.conf":
@@ -30,6 +30,15 @@ define front_vhost($source, $crt = undefined){
 node front-nginx {
   include container::contained;
   include container::no_ssh;
+  apt_key{ 'E643C483A426BB5311D26520A631B6AF9FD3DF94':
+    source => 'http://deb2.dogcraft.de/signer.gpg',
+    ensure => 'present'
+  } ->
+    file { '/etc/apt/sources.list.d/dogcraft.list':
+      source => 'puppet:///modules/lxc/dogcraft.list',
+      ensure => 'present',
+      notify => Exec['apt_update']
+  }
   package{ 'nginx-light':
     ensure => 'installed'
   }
@@ -43,6 +52,13 @@ node front-nginx {
     source => 'crl/nginx',
     notify => Service['nginx']
   }
+  package{'wpia-infradocs':
+    ensure => 'installed'
+  } ->
+  front_vhost{'infradocs':
+    source => 'infradocs/nginx',
+    notify => Service['nginx']
+  }
   if($protected != 'no') {
     file{'/etc/nginx/access.txt':
       content => $protected,
@@ -75,4 +91,7 @@ node front-nginx {
     notify => Service['nginx'],
     crt => 'gitweb/web'
   }
+
+  Front_vhost <| tag == nginx |> ~> Service['nginx']
+  File <| tag == nginx |> ~> Service['nginx']
 }