Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx template listen_address fix #39

Merged
merged 2 commits into from
Apr 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion templates/default/grafana-nginx.conf.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server {
listen <%= "#{@listen_address}:" if @listen_address %><%= @listen_port %>;
listen <%= "#{@listen_address}:" if !@listen_address.nil? && !@listen_address.empty? %><%= @listen_port %>;

server_name <%= @server_name %> <%= @server_aliases.join(" ") %>;
access_log /var/log/nginx/<%= @server_name %>.access.log;
Expand Down
3 changes: 3 additions & 0 deletions test/integration/default/serverspec/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"
gem 'serverspec'
gem 'ohai'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'spec_helper'
require ::File.expand_path('../../spec_helper', __FILE__)

describe file('/srv/apps/grafana') do
let :owner do
Expand Down Expand Up @@ -107,3 +107,7 @@
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
end

describe command("curl http://#{$ohaidata[:ipaddress]}/#/dashboard/file/default.json") do
its(:stdout) { should match /GrafanaCtrl/ }
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'serverspec'
require 'ohai'

set :backend, :exec

Expand All @@ -10,3 +11,7 @@
c.sudo_password = ENV['SUDO_PASSWORD']
end
end

ohai = Ohai::System.new
ohai.all_plugins
$ohaidata = ohai.data