Skip to content
Snippets Groups Projects
Commit a5047620 authored by Balasankar "Balu" C's avatar Balasankar "Balu" C
Browse files

Merge branch...

Merge branch '5057-reconfigure-is-not-creating-all-90-omnibus-gitlab-files-in-opt-gitlab-embedded-etc' into 'master'

Resolve "Reconfigure is not creating all 90-omnibus-gitlab-* files in /opt/gitlab/embedded/etc"

Closes #5057

See merge request gitlab-org/omnibus-gitlab!3921
parents 9cf6f3f3 9c70f265
No related branches found
No related tags found
No related merge requests found
---
title: Fixes sysctl error on reconfigure after reinstall
merge_request: 3921
author:
type: fixed
......@@ -102,6 +102,9 @@
# Install our runit instance
include_recipe "package::runit"
# Make global sysctl commands available
include_recipe "package::sysctl"
# Always run the postgresql::bin recipe
# Run before we enable postgresql for postgresql['version'] to take effect
include_recipe 'postgresql::bin'
......
#
# Copyright:: Copyright (c) 2020 GitLab Inc
# 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.
# ReLoad all sysctl settings
execute "reload all sysctl conf" do
command "sysctl -e --system"
action :nothing
end
......@@ -34,8 +34,9 @@
file "create /opt/gitlab/embedded/etc/#{conf_name} #{new_resource.name}" do
path "/opt/gitlab/embedded/etc/#{conf_name}"
content "#{new_resource.name} = #{new_resource.value}\n"
notifies :run, "execute[load sysctl conf #{new_resource.name}]", :immediately
notifies :run, "execute[load sysctl conf #{new_resource.name}]"
notifies :run, "execute[reload all sysctl conf]"
end
link "/etc/sysctl.d/#{conf_name}" do
to "/opt/gitlab/embedded/etc/#{conf_name}"
......@@ -38,9 +39,10 @@
end
link "/etc/sysctl.d/#{conf_name}" do
to "/opt/gitlab/embedded/etc/#{conf_name}"
notifies :run, "execute[load sysctl conf #{new_resource.name}]", :immediately
notifies :run, "execute[load sysctl conf #{new_resource.name}]"
notifies :run, "execute[reload all sysctl conf]"
end
# Load the settings right away
execute "load sysctl conf #{new_resource.name}" do
......@@ -43,8 +45,8 @@
end
# Load the settings right away
execute "load sysctl conf #{new_resource.name}" do
command "sysctl -e --system"
command "sysctl -e -p /opt/gitlab/embedded/etc/#{conf_name}"
action :nothing
end
end
......@@ -2,7 +2,7 @@
describe 'sysctl' do
let(:runner) { ChefSpec::SoloRunner.new(step_into: %w(gitlab_sysctl)) }
let(:chef_run) { runner.converge("test_package::gitlab_sysctl_create") }
let(:chef_run) { runner.converge("package::sysctl", "test_package::gitlab_sysctl_create") }
let(:conf) { '90-omnibus-gitlab-foo.conf' }
it 'creates sysctl.d directory for the service' do
......@@ -13,7 +13,7 @@
expect(chef_run).to create_file("create /opt/gitlab/embedded/etc/#{conf} foo").with_content("foo = 15000\n")
resource = chef_run.file("create /opt/gitlab/embedded/etc/#{conf} foo")
expect(resource).to notify("execute[load sysctl conf foo]").to(:run).immediately
expect(resource).to notify("execute[load sysctl conf foo]").to(:run).delayed
end
it 'links conf file to /etc/sysctl.d location' do
......@@ -22,7 +22,7 @@
it 'loaded the settings' do
resource = chef_run.execute('load sysctl conf foo')
expect(resource.command).to eq('sysctl -e --system')
expect(resource.command).to eq("sysctl -e -p /opt/gitlab/embedded/etc/#{conf}")
expect(resource).to do_nothing
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment