itamae-plugin-recipe-nginx_build 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b04cdd5719b7dba6c55e696134518fefa1d2cb6
4
- data.tar.gz: d30db3a2978703f22cef085e9feca0db4337823d
3
+ metadata.gz: 37eaf0f254530642430a59da8bf226d0f171816e
4
+ data.tar.gz: 128f02b217f6550d5a146a97c014040ce472ebe0
5
5
  SHA512:
6
- metadata.gz: 70d287037ebf0af11abadd65e74ab4e809b0bca18c1755e129d2bd710f04c58c5a986d1ae2b3915aa19805274fdc78f76bc7909aaf83d60c9f1536eab6d778ff
7
- data.tar.gz: 28228bce16acc3d78ffec8b00ecf1febbfb941716b75965ef71223fb154d4f399e0d4113523e7788734039e3b6ef30a30c6b0010cadadd28ac00515546ff7ea9
6
+ metadata.gz: dc405a60fb706e06ab5b9ec7014d1b0ac441419364c45ea1f2478d71015cad82c3193de9a5f98f83499a2ddf24859a4ecaeeef791b8df877ee84709fdc47c8c4
7
+ data.tar.gz: 641340093d583222d7314ef3dfedb4494eb54c5eb1f6ba75206bfd7785d6f637fd45bba8c7b78fbe2ae256028678dd87df8ac12979df4a5d45cb2325b4a73ee4
data/README.md CHANGED
@@ -70,6 +70,11 @@ nginx_build:
70
70
  shprov: ./setup
71
71
  configure_path: /usr/local/nginx_build/configure.sh
72
72
  modules3rd_path: /usr/local/nginx_build/modules3rd.ini
73
+ configure_options:
74
+ prefix: /etc/nginx
75
+ error-log-path: /var/log/nginx/error.log
76
+ http-log-path: /var/log/nginx/access.log
77
+
73
78
  ```
74
79
 
75
80
  ## Contributing
@@ -1,3 +1,14 @@
1
+ def build_nginx_configure_options
2
+ nginx_configure_options = %w(--with-http_ssl_module)
3
+ if node[:nginx_build] && node[:nginx_build][:modules]
4
+ nginx_configure_options = node[:nginx_build][:modules].map {|mod| "--with-#{mod}" }
5
+ end
6
+ if node[:nginx_build] && node[:nginx_build][:configure_options]
7
+ nginx_configure_options |= node[:nginx_build][:configure_options].map {|k, v| "--#{k}=#{v}" }
8
+ end
9
+ nginx_configure_options
10
+ end
11
+
1
12
  nginx_build_bin = "/usr/local/bin/"
2
13
  nginx_build_bin = node[:nginx_build][:bin] if node[:nginx_build] && node[:nginx_build][:bin]
3
14
 
@@ -16,8 +27,7 @@ nginx_conf = node[:nginx_build][:nginx_conf] if node[:nginx_build] && node[:ngin
16
27
  nginx_pid = "/var/run/nginx.pid"
17
28
  nginx_pid = node[:nginx_build][:nginx_pid] if node[:nginx_build] && node[:nginx_build][:nginx_pid]
18
29
 
19
- nginx_modules = %w(http_ssl_module)
20
- nginx_modules = node[:nginx_build][:modules] if node[:nginx_build] && node[:nginx_build][:modules]
30
+ nginx_configure_options = build_nginx_configure_options
21
31
 
22
32
  configure_path = '/usr/local/nginx_build/configure.sh'
23
33
  configure_path = node[:nginx_build][:configure_path] if node[:nginx_build] && node[:nginx_build][:configure_path]
@@ -40,12 +50,12 @@ if configure_path =~ /^(.+)\/([^\/]+)$/
40
50
  template configure_path do
41
51
  source "./templates/configure.sh.erb"
42
52
  variables({
43
- "nginx_user" => nginx_user,
44
- "nginx_group" => nginx_group,
45
- "nginx_sbin" => nginx_sbin,
46
- "nginx_conf" => nginx_conf,
47
- "nginx_pid" => nginx_pid,
48
- "nginx_modules" => nginx_modules
53
+ "nginx_user" => nginx_user,
54
+ "nginx_group" => nginx_group,
55
+ "nginx_sbin" => nginx_sbin,
56
+ "nginx_conf" => nginx_conf,
57
+ "nginx_pid" => nginx_pid,
58
+ "nginx_configure_options" => nginx_configure_options,
49
59
  })
50
60
 
51
61
  notifies :run, 'execute[build-nginx]'
@@ -6,4 +6,4 @@
6
6
  --sbin-path=<%=@nginx_sbin%> \
7
7
  --conf-path=<%=@nginx_conf%> \
8
8
  --pid-path=<%=@nginx_pid%> \
9
- <% @nginx_modules.each {|m| %> --with-<%=m%> <% } %>
9
+ <%= @nginx_configure_options.join(' ') %>
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module NginxBuild
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-nginx_build
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - zaru
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-26 00:00:00.000000000 Z
11
+ date: 2016-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae