Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Add begin..rescue so we can remove apache pinning
Browse files Browse the repository at this point in the history
  • Loading branch information
linc01n committed Apr 24, 2016
1 parent 0742842 commit f5d2f00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
supports 'scientific'
supports 'ubuntu'

depends 'apache2', '>= 3.2.0'
depends 'apache2'
depends 'ark'
depends 'cron'
depends 'database'
Expand Down
13 changes: 9 additions & 4 deletions recipes/apache2.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
node.default['apache']['listen'] |= [
"*:#{node['stash']['apache2']['port']}",
"*:#{node['stash']['apache2']['ssl']['port']}"
]
begin
node.set['apache']['listen_ports'] = node['apache']['listen_ports'] + [node['stash']['apache2']['port']] unless node['apache']['listen_ports'].include?(node['stash']['apache2']['port'])
node.set['apache']['listen_ports'] = node['apache']['listen_ports'] + [node['stash']['apache2']['ssl']['port']] unless node['apache']['listen_ports'].include?(node['stash']['apache2']['ssl']['port'])
rescue NoMethodError
node.default['apache']['listen'] |= [
"*:#{node['stash']['apache2']['port']}",
"*:#{node['stash']['apache2']['ssl']['port']}"
]
end

include_recipe 'apache2'
include_recipe 'apache2::mod_proxy'
Expand Down

0 comments on commit f5d2f00

Please sign in to comment.