Skip to content

Commit

Permalink
Improve disabling nginx default site
Browse files Browse the repository at this point in the history
  • Loading branch information
zuazo committed Oct 2, 2015
1 parent 2c2991d commit 8df835f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
23 changes: 23 additions & 0 deletions attributes/nginx.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# encoding: UTF-8
#
# Cookbook Name:: owncloud
# Attributes:: nginx
# Author:: Xabier de Zuazo (<xabier@zuazo.org>)
# Copyright:: Copyright (c) 2015 Xabier de Zuazo
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Disable default site
node.default['nginx']['default_site_enabled'] = false
5 changes: 2 additions & 3 deletions test/unit/recipes/_nginx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@
end

it 'disables nginx default site' do
allow(::File).to receive(:symlink?)
.with('/etc/nginx/sites-enabled/default').and_return(true)
expect(chef_run).to run_execute('nxdissite default')
chef_run
expect(node['nginx']['default_site_enabled']).to eq(false)
end

it 'creates owncloud virtualhost' do
Expand Down

0 comments on commit 8df835f

Please sign in to comment.