Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert template errors introduced in commit 4dd435e
  • Loading branch information
javierbertoli committed Nov 26, 2013
commit 7a38ad1ad724b990a42eefa318e1ba557a93f7b9
41 changes: 39 additions & 2 deletions spec/classes/nginx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,46 @@
:template => "nginx/conf.d/nginx.conf.erb"
}
end
let(:expected) do
'# File Managed by Puppet
user www-data;
worker_processes 8;

error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
#
}

http {
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;

access_log /var/log/nginx/access.log;

sendfile on;
#tcp_nopush on;
tcp_nodelay on;
client_max_body_size 10m;
keepalive_timeout 65;
server_names_hash_bucket_size 64;
types_hash_max_size 1024;

gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";


include /etc/nginx/conf.d/*.conf;

include /etc/nginx/sites-available/*.conf;
}
'
end
it 'should generate a valid template' do
content = catalogue.resource('file', 'nginx.conf').send(:parameters)[:content]
content.should match "user www-data"
should contain_file('nginx.conf').with_content(expected)
end
end

Expand Down
5 changes: 0 additions & 5 deletions templates/conf.d/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,5 @@ http {
<% if scope.lookupvar('nginx::cdir') != '' %>
include <%= scope.lookupvar('nginx::cdir')%>/*.conf;
<% end %>
<% if scope.lookupvar('::operatingsystem') =~ /(?i:Ubuntu|Debian|Mint)/ %>
include <%= scope.lookupvar('nginx::config_dir') %>/conf.d/*.conf;
include <%= scope.lookupvar('nginx::config_dir') %>/sites-enabled/*;
<% else %>
include <%= scope.lookupvar('nginx::vdir')%>/*.conf;
<% end %>
}