provizioning 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Provizioning
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.4"
3
3
  end
@@ -32,6 +32,7 @@ class nginx::fcgi inherits nginx {
32
32
  #
33
33
  # Templates :
34
34
  # * nginx/fcgi_site.erb
35
+ # * nginx/fcgi_drupal_site.erb
35
36
  #
36
37
  # Sample Usage :
37
38
  # nginx::fcgi::site {"default":
@@ -46,23 +47,30 @@ class nginx::fcgi inherits nginx {
46
47
  # fastcgi_pass => "127.0.0.1:9000",
47
48
  # server_name => "$fqdn",
48
49
  # }
49
- define site ( $ensure = 'present', $index = 'index.php', $root, $fastcgi_pass, $include = '', $listen = '80', $server_name = '', $access_log = '', $error_log = '', $ssl_certificate = '', $ssl_certificate_key = '', $ssl_session_timeout = '5m') {
50
+ #
51
+ # nginx::fcgi::drupal_site {"default":
52
+ # root => "/var/www/nginx-default",
53
+ # fastcgi_pass => "127.0.0.1:9000",
54
+ # server_name => ["localhost", "$hostname", "$fqdn"],
55
+ # }
56
+ #
57
+
58
+ define site($ensure = 'present', $index = 'index.php', $root, $fastcgi_pass, $template = "nginx/fcgi_site.erb", $include = '', $listen = '80', $server_name = '', $access_log = '', $error_log = '', $ssl_certificate = '', $ssl_certificate_key = '', $ssl_session_timeout = '5m') {
50
59
 
51
60
  $real_server_name = $server_name ? {
52
61
  '' => "${name}",
53
- default => $server_name,
54
- }
62
+ default => $server_name,
63
+ }
55
64
 
56
65
  $real_access_log = $access_log ? {
57
66
  '' => "/var/log/nginx/${name}_access.log",
58
- default => $access_log,
59
- }
60
-
61
- $real_error_log = $error_log ? {
62
- '' => "/var/log/nginx/${name}_error.log",
63
- default => $error_log,
64
- }
67
+ default => $access_log,
68
+ }
65
69
 
70
+ $real_error_log = $error_log ? {
71
+ '' => "/var/log/nginx/${name}_error.log",
72
+ default => $error_log,
73
+ }
66
74
 
67
75
  #Autogenerating ssl certs
68
76
  if $listen == '443' and $ensure == 'present' and ( $ssl_certificate == '' or $ssl_certificate_key == '') {
@@ -76,18 +84,22 @@ class nginx::fcgi inherits nginx {
76
84
 
77
85
  $real_ssl_certificate = $ssl_certificate ? {
78
86
  '' => "/etc/nginx/ssl/${name}.pem",
79
- default => $ssl_certificate,
80
- }
81
- $real_ssl_certificate_key = $ssl_certificate_key ? {
87
+ default => $ssl_certificate,
88
+ }
89
+
90
+ $real_ssl_certificate_key = $ssl_certificate_key ? {
82
91
  '' => "/etc/nginx/ssl/${name}.key",
83
- default => $ssl_certificate_key,
84
- }
92
+ default => $ssl_certificate_key,
93
+ }
85
94
 
86
95
  nginx::site {"${name}":
87
96
  ensure => $ensure,
88
- content => template("nginx/fcgi_site.erb"),
97
+ content => template($template),
89
98
  }
90
99
 
91
100
  }
92
-
101
+
102
+ define drupal_site($ensure = 'present', $index = 'index.php', $root, $fastcgi_pass, $include = '', $listen = '80', $server_name = '', $access_log = '', $error_log = '', $ssl_certificate = '', $ssl_certificate_key = '', $ssl_session_timeout = '5m') {
103
+ nginx::fcgi::site($ensure, $index, $root, $fastcgi_pass, "nginx/fcgi_drupal_site.erb", $include, $listen, $server_name, $access_log, $error_log, $ssl_certificate, $ssl_certificate_key, $ssl_session_timeout)
104
+ }
93
105
  }
@@ -51,7 +51,7 @@ server {
51
51
  include /etc/nginx/fastcgi_params;
52
52
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
53
53
  fastcgi_intercept_errors on;
54
- fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
54
+ fastcgi_pass <%= fastcgi_pass %>;
55
55
  }
56
56
 
57
57
  # Fighting with ImageCache? This little gem is amazing.
@@ -63,4 +63,4 @@ server {
63
63
  expires max;
64
64
  log_not_found off;
65
65
  }
66
- }
66
+ }
@@ -10,6 +10,15 @@ server {
10
10
  keepalive_timeout 5;
11
11
 
12
12
  root <%= deploy_to %>/current/public;
13
+
14
+ if (-f $document_root/system/maintenance.html) {
15
+ return 503;
16
+ }
17
+ error_page 503 @maintenance;
18
+ location @maintenance {
19
+ rewrite ^(.*)$ /system/maintenance.html last;
20
+ break;
21
+ }
13
22
 
14
23
  location ~ ^/(assets)/ {
15
24
  gzip_static on; # to serve pre-gzipped version
@@ -32,4 +41,4 @@ server {
32
41
  location = /500.html {
33
42
  root <%= deploy_to %>/current/public;
34
43
  }
35
- }
44
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: provizioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-11 00:00:00.000000000 Z
12
+ date: 2012-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
- requirement: &70093075523280 !ruby/object:Gem::Requirement
16
+ requirement: &70293545794800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70093075523280
24
+ version_requirements: *70293545794800
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: capistrano-ext
27
- requirement: &70093075522760 !ruby/object:Gem::Requirement
27
+ requirement: &70293545794000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70093075522760
35
+ version_requirements: *70293545794000
36
36
  description: Puppet server provisioning tools, recipes and templates
37
37
  email:
38
38
  - victor.castell@season.es