Skip to content

Commit 3268fd1

Browse files
author
Joshua Timberman
committed
Merge pull request sous-chefs#94 from trobrock/COOK-1976
[COOK-1976] Enable the configuration of the sbin path
2 parents 24e853c + e91c542 commit 3268fd1

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
.cache
33
.kitchen
44
bin
5+
*.sw*
56
.Vagrantfile
67
Gemfile.lock

attributes/source.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323

2424
default['nginx']['source']['prefix'] = "/opt/nginx-#{node['nginx']['version']}"
2525
default['nginx']['source']['conf_path'] = "#{node['nginx']['dir']}/nginx.conf"
26+
default['nginx']['source']['sbin_path'] = "#{node['nginx']['source']['prefix']}/sbin/nginx"
2627
default['nginx']['source']['default_configure_flags'] = [
2728
"--prefix=#{node['nginx']['source']['prefix']}",
28-
"--conf-path=#{node['nginx']['dir']}/nginx.conf"
29+
"--conf-path=#{node['nginx']['dir']}/nginx.conf",
30+
"--sbin-path=#{node['nginx']['source']['sbin_path']}"
2931
]
3032

3133
default['nginx']['configure_flags'] = Array.new

recipes/source.rb

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,12 @@
2121
# limitations under the License.
2222
#
2323

24+
node.load_attribute_by_short_filename('source', 'nginx') if node.respond_to?(:load_attribute_by_short_filename)
2425

2526
nginx_url = node['nginx']['source']['url'] ||
2627
"http://nginx.org/download/nginx-#{node['nginx']['version']}.tar.gz"
2728

28-
unless(node['nginx']['source']['prefix'])
29-
node.set['nginx']['source']['prefix'] = "/opt/nginx-#{node['nginx']['version']}"
30-
end
31-
unless(node['nginx']['source']['conf_path'])
32-
node.set['nginx']['source']['conf_path'] = "#{node['nginx']['dir']}/nginx.conf"
33-
end
34-
unless(node['nginx']['source']['default_configure_flags'])
35-
node.set['nginx']['source']['default_configure_flags'] = [
36-
"--prefix=#{node['nginx']['source']['prefix']}",
37-
"--conf-path=#{node['nginx']['dir']}/nginx.conf"
38-
]
39-
end
40-
node.set['nginx']['binary'] = "#{node['nginx']['source']['prefix']}/sbin/nginx"
29+
node.set['nginx']['binary'] = node['nginx']['source']['sbin_path']
4130
node.set['nginx']['daemon_disable'] = true
4231

4332
user node['nginx']['user'] do

0 commit comments

Comments
 (0)