Commit 02b4634c authored by Marin Jankovski's avatar Marin Jankovski

Add option to specify redis database. Fixes #67

parent 2403682a
......@@ -38,6 +38,7 @@ default['gitlab']['shell_path'] = "#{node['gitlab']['home']}/gitlab-shell"
default['gitlab']['redis_path'] = "/usr/local/bin/redis-cli"
default['gitlab']['redis_host'] = "127.0.0.1"
default['gitlab']['redis_port'] = "6379"
default['gitlab']['redis_database'] = nil # Default value is 0
default['gitlab']['namespace'] = "resque:gitlab"
default['gitlab']['self_signed_cert'] = false
......
......@@ -18,6 +18,7 @@ template File.join(gitlab['shell_path'], "config.yml") do
:redis_path => gitlab['redis_path'],
:redis_host => gitlab['redis_host'],
:redis_port => gitlab['redis_port'],
:redis_database => gitlab['redis_database'],
:namespace => gitlab['namespace'],
:self_signed_cert => gitlab['self_signed_cert']
})
......
......@@ -23,6 +23,7 @@ describe "gitlab::gitlab_shell_install" do
redis_path: "/usr/local/bin/redis-cli",
redis_host: "127.0.0.1",
redis_port: "6379",
redis_database: nil,
namespace: "resque:gitlab",
self_signed_cert: false
}
......@@ -62,6 +63,7 @@ describe "gitlab::gitlab_shell_install" do
runner = ChefSpec::Runner.new(platform: "ubuntu", version: version)
runner.node.set['gitlab']['env'] = "production"
runner.node.set['gitlab']['home'] = "/data/git"
runner.node.set['gitlab']['redis_database'] = 2
runner.converge("gitlab::gitlab_shell_install")
end
......@@ -76,6 +78,7 @@ describe "gitlab::gitlab_shell_install" do
redis_path: "/usr/local/bin/redis-cli",
redis_host: "127.0.0.1",
redis_port: "6379",
redis_database: 2,
namespace: "resque:gitlab",
self_signed_cert: false
}
......@@ -102,6 +105,7 @@ describe "gitlab::gitlab_shell_install" do
let(:chef_run) do
runner = ChefSpec::Runner.new(platform: "centos", version: version)
runner.node.set['gitlab']['env'] = "production"
runner.node.set['gitlab']['redis_database'] = 3
runner.converge("gitlab::gitlab_shell_install")
end
......@@ -116,6 +120,7 @@ describe "gitlab::gitlab_shell_install" do
redis_path: "/usr/local/bin/redis-cli",
redis_host: "127.0.0.1",
redis_port: "6379",
redis_database: 3,
namespace: "resque:gitlab",
self_signed_cert: false
}
......@@ -169,6 +174,7 @@ describe "gitlab::gitlab_shell_install" do
redis_path: "/usr/local/bin/redis-cli",
redis_host: "127.0.0.1",
redis_port: "6379",
redis_database: nil,
namespace: "resque:gitlab",
self_signed_cert: false
}
......
......@@ -29,6 +29,9 @@ redis:
bin: <%= @redis_path %>
host: <%= @redis_host %>
port: <%= @redis_port %>
<% if @redis_database %>
database: <%= @redis_database %>
<% end %>
# socket: /tmp/redis.socket # Only define this if you want to use sockets
namespace: <%= @namespace %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment