Skip to content

Commit ed89250

Browse files
balasankarcClemens Beck
andcommitted
Merge branch 'revert-a7aec7e8' into 'master'
Revert "Merge branch '8285-support-external-consul' into 'master'" See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7277 Merged-by: Balasankar 'Balu' C <[email protected]> Approved-by: Balasankar 'Balu' C <[email protected]> Co-authored-by: Clemens Beck <[email protected]>
2 parents f97260d + ac93a77 commit ed89250

File tree

13 files changed

+8
-196
lines changed

13 files changed

+8
-196
lines changed

config/software/consul.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
name 'consul'
1818

19-
# This version should be keep in sync with consul versions in
20-
# software/consul.rb and consul_helper.rb.
2119
version = Gitlab::Version.new('consul', 'v1.16.3')
2220
default_version version.print(false)
2321

deps.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ dependencies:
7979
- filename: config/software/consul.rb
8080
pattern: "version = Gitlab::Version.new\\('consul', 'v(\\S+)'\\)"
8181
range: '< 1.17.0'
82-
- filename: files/gitlab-ctl-commands-ee/lib/consul_download.rb
83-
pattern: "DEFAULT_VERSION = '(\\S+)'"
84-
range: '< 1.17.0'
85-
- filename: files/gitlab-cookbooks/consul/libraries/consul_helper.rb
86-
pattern: "SUPPORTED_MINOR = '(\\S+)'"
87-
tag_filter:
88-
output_as: '$1.$2'
8982
# go-crond
9083
https://github.com/webdevops/go-crond.git:
9184
replace_in_files:

files/gitlab-config-template/gitlab.rb.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3234,7 +3234,6 @@ external_url 'GENERATED_EXTERNAL_URL'
32343234
# Consul (EE only)
32353235
################################################################################
32363236
# consul['enable'] = false
3237-
# consul['binary_path'] = '/opt/gitlab/embedded/bin/consul'
32383237
# consul['dir'] = '/var/opt/gitlab/consul'
32393238
# consul['username'] = 'gitlab-consul'
32403239
# consul['group'] = 'gitlab-consul'

files/gitlab-cookbooks/consul/attributes/default.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
default['consul']['enable'] = false
2-
default['consul']['binary_path'] = '/opt/gitlab/embedded/bin/consul'
32
default['consul']['dir'] = '/var/opt/gitlab/consul'
43
default['consul']['username'] = 'gitlab-consul'
54
default['consul']['group'] = 'gitlab-consul'

files/gitlab-cookbooks/consul/libraries/consul_helper.rb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ class ConsulHelper
99
# provide an `enable_service_#{service_name}` and `disable_service_#{service_name}` recipe
1010
SERVICES = %w(postgresql).freeze
1111

12-
# This version should be keep in sync with consul versions in
13-
# software/consul.rb and consul_helper.rb.
14-
SUPPORTED_MINOR = '1.16'.freeze
15-
1612
def initialize(node)
1713
@node = node
1814
@default_configuration = {
@@ -180,7 +176,7 @@ def disabled_services
180176
def installed_version
181177
return unless OmnibusHelper.new(@node).service_up?('consul')
182178

183-
command = "#{@node['consul']['binary_path']} version"
179+
command = '/opt/gitlab/embedded/bin/consul version'
184180
command_output = VersionHelper.version(command)
185181
raise "Execution of the command `#{command}` failed" unless command_output
186182

@@ -199,13 +195,6 @@ def running_version
199195
info[:Config][:Version] unless info.empty?
200196
end
201197

202-
def installed_is_supported?
203-
major_installed, minor_installed = installed_version.split('.')[0..1]
204-
major_supported, minor_supported = SUPPORTED_MINOR.split('.')
205-
206-
major_installed == major_supported && minor_installed == minor_supported
207-
end
208-
209198
private
210199

211200
def verify_incoming?

files/gitlab-cookbooks/consul/recipes/enable_daemon.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
runit_service 'consul' do
2222
options({
23-
binary_path: node['consul']['binary_path'],
2423
config_dir: node['consul']['config_dir'],
2524
custom_config_dir: node['consul']['custom_config_dir'],
2625
config_file: node['consul']['config_file'],
@@ -58,17 +57,3 @@
5857
end
5958
only_if { consul_helper.running_version != consul_helper.installed_version }
6059
end
61-
62-
ruby_block 'warn consul version mismatch' do
63-
block do
64-
message = <<~MESSAGE
65-
The version of the installed consul service is different than what is expected.
66-
Please run `gitlab-ctl consul-download --force` and restart consul to start
67-
the new version:
68-
69-
https://docs.gitlab.com/ee/administration/consul.html#restart-consul
70-
MESSAGE
71-
LoggingHelper.warning(message)
72-
end
73-
only_if { consul_helper.installed_is_supported? }
74-
end

files/gitlab-cookbooks/consul/templates/default/sv-consul-run.erb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ cd <%= @options[:dir] %>
99
exec chpst -P -e <%= @options[:env_dir] %> \
1010
-U <%= @options[:user] %>:<%= @options[:groupname] %> \
1111
-u <%= @options[:user] %>:<%= @options[:groupname] %> \
12-
<%= @options[:binary_path] %> \
13-
agent \
14-
-config-file <%= @options[:config_file] %> \
12+
/opt/gitlab/embedded/bin/consul agent -config-file <%= @options[:config_file] %> \
1513
-config-dir <%= @options[:config_dir] %> \
1614
<% unless @options[:custom_config_dir].nil? -%>
1715
-config-dir <%= @options[:custom_config_dir] %> \

files/gitlab-ctl-commands-ee/consul.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@
1515
#
1616

1717
require "#{base_path}/embedded/service/omnibus-ctl-ee/lib/consul"
18-
require "#{base_path}/embedded/service/omnibus-ctl-ee/lib/consul_download"
1918

2019
add_command_under_category('consul', 'consul', 'Interact with the gitlab-consul cluster', 2) do
2120
consul = ConsulHandler.new(ARGV, $stdin.gets)
2221
consul.execute
2322
end
24-
25-
add_command_under_category('consul-download', 'consul', 'Download consul for the gitlab-consul cluster', 2) do
26-
ConsulDownloadCommand.new(ARGV).run
27-
end

files/gitlab-ctl-commands-ee/lib/consul.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
require 'mixlib/shellout'
2-
# For testing purposes, if the first path cannot be found load the second
3-
begin
4-
require_relative '../../omnibus-ctl/lib/gitlab_ctl'
5-
rescue LoadError
6-
require_relative '../../gitlab-ctl-commands/lib/gitlab_ctl'
7-
end
82

93
class ConsulHandler
104
WatcherError = Class.new(StandardError)
@@ -23,7 +17,7 @@ def execute
2317

2418
class << self
2519
def run_consul(cmd)
26-
command = Mixlib::ShellOut.new("#{consul_binary} #{cmd}")
20+
command = Mixlib::ShellOut.new("/opt/gitlab/embedded/bin/consul #{cmd}")
2721
command.run_command
2822
begin
2923
command.error!
@@ -34,12 +28,6 @@ def run_consul(cmd)
3428
end
3529
command.stdout
3630
end
37-
38-
private
39-
40-
def consul_binary
41-
GitlabCtl::Util.get_node_attributes.dig('consul', 'binary_path')
42-
end
4331
end
4432

4533
class Kv

files/gitlab-ctl-commands-ee/lib/consul_download.rb

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)