Commit 33a3184d authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'feature-custom-nginx-install' into 'master'

Feature custom nginx install

This new attribute (`node['gitlab']['install_nginx']`) will prevent nginx installation. Only the installation part is affected by this change, not gitlab nginx configuration.

This enable us to install our custom, source version of nginx.
parents b6757fca 739058a7
......@@ -169,7 +169,8 @@ default['postfix']['smtp_use_tls'] = "no"
default['gitlab']['unicorn_workers_number'] = 2
default['gitlab']['unicorn_timeout'] = 30
# Nginx ssl certificates
# Nginx & Nginx ssl certificates
default['gitlab']['install_nginx'] = true
default['gitlab']['ssl_certificate_path'] = "/etc/ssl" # Path to .crt file. If it directory doesn't exist it will be created
default['gitlab']['ssl_certificate_key_path'] = "/etc/ssl" # Path to .key file. If directory doesn't exist it will be created
default['gitlab']['ssl_certificate'] = "" # SSL certificate
......
......@@ -9,7 +9,7 @@ gitlab = node['gitlab']
## Installation
package "nginx" do
action :install
end
end if gitlab['install_nginx']
## Site Configuration
path = platform_family?("rhel") ? "/etc/nginx/conf.d/gitlab.conf" : "/etc/nginx/sites-available/gitlab"
......
......@@ -76,6 +76,19 @@ describe "gitlab::nginx" do
expect(chef_run).to_not create_directory('/data/git')
end
end
describe "when customizing install_nginx" do
let(:chef_run) do
runner = ChefSpec::Runner.new(platform: "ubuntu", version: version)
runner.node.set['gitlab']['env'] = "production"
runner.node.set['gitlab']['install_nginx'] = false
runner.converge("gitlab::nginx")
end
it 'does not install nginx' do
expect(chef_run).to_not install_package('nginx')
end
end
end
end
......@@ -147,6 +160,19 @@ describe "gitlab::nginx" do
expect(chef_run).to create_directory('/data/git')
end
end
describe "when customizing install_nginx" do
let(:chef_run) do
runner = ChefSpec::Runner.new(platform: "centos", version: version)
runner.node.set['gitlab']['env'] = "production"
runner.node.set['gitlab']['install_nginx'] = false
runner.converge("gitlab::nginx")
end
it 'does not install nginx' do
expect(chef_run).to_not install_package('nginx')
end
end
end
end
end
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