Skip to content

Commit

Permalink
Merge pull request #183 from jenssegers/master
Browse files Browse the repository at this point in the history
Allow the user to pass a site template file
  • Loading branch information
miketheman committed Mar 14, 2015
2 parents 4e46041 + c8c39a9 commit ba610d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions definitions/nginx_site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@

define :nginx_site, :enable => true, :timing => :delayed do
if params[:enable]

if params[:template]
template "#{node['nginx']['dir']}/sites-available/#{params[:name]}" do
source params[:template]
variables (params[:variables])
end
end

execute "nxensite #{params[:name]}" do
command "#{node['nginx']['script_dir']}/nxensite #{params[:name]}"
notifies :reload, 'service[nginx]', params[:timing]
Expand Down

0 comments on commit ba610d1

Please sign in to comment.