manageiq-appliance_console 7.1.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/bin/appliance_console +43 -29
- data/lib/manageiq/appliance_console/cli.rb +3 -5
- data/lib/manageiq/appliance_console/database_admin.rb +1 -1
- data/lib/manageiq/appliance_console/database_configuration.rb +2 -14
- data/lib/manageiq/appliance_console/evm_server.rb +66 -0
- data/lib/manageiq/appliance_console/external_database_configuration.rb +0 -4
- data/lib/manageiq/appliance_console/internal_database_configuration.rb +4 -9
- data/lib/manageiq/appliance_console/logfile_configuration.rb +3 -3
- data/lib/manageiq/appliance_console/message_configuration.rb +11 -25
- data/lib/manageiq/appliance_console/message_configuration_client.rb +4 -2
- data/lib/manageiq/appliance_console/message_configuration_server.rb +5 -3
- data/lib/manageiq/appliance_console/utilities.rb +6 -1
- data/lib/manageiq/appliance_console/version.rb +1 -1
- data/lib/manageiq-appliance_console.rb +1 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ad20683e3cdb9f2f4dfb894e34ba2dedd81aeb6e511db18caae12b92499d5c0
|
4
|
+
data.tar.gz: 4eee448a7715b15f61e325a066c500d7fd40af1b01683d74d74659d215e364cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f1d185402221742019cea8006f5cae97322c3a0fa01eb90cb5f1be821424e4ca3f2e5d2091cc9726b398e6485bc34bbf0c584f124af881607bb2ed470e23757
|
7
|
+
data.tar.gz: 440c7adb764a120a9690851f6046e4206be2d8c5bbc2ea998944646de5144de20031c4feeb98a49392f35743a1833ec529dd6f52ab77b43ce9404540e018e6fc
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
|
5
|
+
## [Unreleased]
|
6
|
+
|
7
|
+
## [8.0.0] - 2022-10-18
|
8
|
+
### Fixed
|
9
|
+
- Don't require pressing any key twice for message configuration (#193)
|
10
|
+
|
11
|
+
### Added
|
12
|
+
- Report messaging configuration on summary info page (#190)
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
- Refactor EvmServer operations (#194)
|
16
|
+
- Only start evmserverd after all application configuration is done (#195)
|
17
|
+
- **BREAKING** Don't start evmserverd until messaging is configured (#196)
|
18
|
+
- Simplify messaging options by saving in yml files (#197)
|
19
|
+
|
20
|
+
[Unreleased]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v8.0.0...HEAD
|
21
|
+
[8.0.0]: https://github.com/ManageIQ/manageiq-appliance_console/compare/v7.1.1..v8.0.0
|
data/bin/appliance_console
CHANGED
@@ -92,18 +92,26 @@ module ApplianceConsole
|
|
92
92
|
eth0.reload
|
93
93
|
eth0.parse_conf if eth0.respond_to?(:parse_conf)
|
94
94
|
|
95
|
-
host
|
96
|
-
ip
|
97
|
-
mac
|
98
|
-
mask
|
99
|
-
gw
|
100
|
-
dns1, dns2
|
101
|
-
order
|
102
|
-
timezone
|
103
|
-
version
|
104
|
-
dbhost
|
105
|
-
database
|
106
|
-
|
95
|
+
host = LinuxAdmin::Hosts.new.hostname
|
96
|
+
ip = eth0.address
|
97
|
+
mac = eth0.mac_address
|
98
|
+
mask = eth0.netmask
|
99
|
+
gw = eth0.gateway
|
100
|
+
dns1, dns2 = dns.nameservers
|
101
|
+
order = dns.search_order.join(' ')
|
102
|
+
timezone = LinuxAdmin::TimeDate.system_timezone
|
103
|
+
version = File.read(VERSION_FILE).chomp if File.exist?(VERSION_FILE)
|
104
|
+
dbhost = ManageIQ::ApplianceConsole::DatabaseConfiguration.database_host
|
105
|
+
database = ManageIQ::ApplianceConsole::DatabaseConfiguration.database_name
|
106
|
+
messaging = ManageIQ::ApplianceConsole::MessageConfiguration.configured?
|
107
|
+
messaging_broker = ManageIQ::ApplianceConsole::MessageServerConfiguration.configured?
|
108
|
+
evm_status = if ManageIQ::ApplianceConsole::EvmServer.running?
|
109
|
+
"running"
|
110
|
+
elsif ManageIQ::ApplianceConsole::EvmServer.runnable?
|
111
|
+
"not running"
|
112
|
+
else
|
113
|
+
"not configured"
|
114
|
+
end
|
107
115
|
|
108
116
|
summary_attributes = [
|
109
117
|
summary_entry("Hostname", host),
|
@@ -117,9 +125,11 @@ module ApplianceConsole
|
|
117
125
|
summary_entry("MAC Address", mac),
|
118
126
|
summary_entry("Timezone", timezone),
|
119
127
|
summary_entry("Local Database Server", PostgresAdmin.local_server_status),
|
120
|
-
summary_entry("#{I18n.t("product.name")} Server",
|
128
|
+
summary_entry("#{I18n.t("product.name")} Server", evm_status),
|
121
129
|
summary_entry("#{I18n.t("product.name")} Database", dbhost || "not configured"),
|
122
130
|
summary_entry("Database/Region", database ? "#{database} / #{region.to_i}" : "not configured"),
|
131
|
+
summary_entry("Messaging", messaging ? "configured" : "not configured"),
|
132
|
+
summary_entry("Local Messaging Broker", messaging_broker ? "configured" : "not configured"),
|
123
133
|
summary_entry("External Auth", ExternalHttpdAuthentication.config_status),
|
124
134
|
summary_entry("#{I18n.t("product.name")} Version", version),
|
125
135
|
]
|
@@ -322,12 +332,11 @@ Static Network Configuration
|
|
322
332
|
|
323
333
|
when I18n.t("advanced_settings.evmstop")
|
324
334
|
say("#{selection}\n\n")
|
325
|
-
|
326
|
-
if service.running?
|
335
|
+
if ManageIQ::ApplianceConsole::EvmServer.running?
|
327
336
|
if ask_yn? "\nNote: It may take up to a few minutes for all #{I18n.t("product.name")} server processes to exit gracefully. Stop #{I18n.t("product.name")}"
|
328
337
|
say("\nStopping #{I18n.t("product.name")} Server...")
|
329
338
|
logger.info("EVM server stop initiated by appliance console.")
|
330
|
-
|
339
|
+
ManageIQ::ApplianceConsole::EvmServer.stop
|
331
340
|
end
|
332
341
|
else
|
333
342
|
say("\n#{I18n.t("product.name")} Server is not running...")
|
@@ -339,13 +348,7 @@ Static Network Configuration
|
|
339
348
|
if ask_yn?("\nStart #{I18n.t("product.name")}")
|
340
349
|
say("\nStarting #{I18n.t("product.name")} Server...")
|
341
350
|
logger.info("EVM server start initiated by appliance console.")
|
342
|
-
|
343
|
-
LinuxAdmin::Service.new("evmserverd").start
|
344
|
-
rescue AwesomeSpawn::CommandResultError => e
|
345
|
-
say e.result.output
|
346
|
-
say e.result.error
|
347
|
-
say ""
|
348
|
-
end
|
351
|
+
ManageIQ::ApplianceConsole::EvmServer.start
|
349
352
|
press_any_key
|
350
353
|
end
|
351
354
|
|
@@ -396,6 +399,14 @@ Static Network Configuration
|
|
396
399
|
|
397
400
|
messaging_action = ask_with_menu("Configure Messaging", messaging_options)
|
398
401
|
|
402
|
+
changes_requested = database_action != "no_changes" || messaging_action != "no_changes"
|
403
|
+
|
404
|
+
# Stop evmserver while we make changes to the database and/or messaging configuration
|
405
|
+
if changes_requested
|
406
|
+
say("\nStopping #{I18n.t("product.name")} Server...")
|
407
|
+
ManageIQ::ApplianceConsole::EvmServer.stop
|
408
|
+
end
|
409
|
+
|
399
410
|
database_configuration =
|
400
411
|
case database_action
|
401
412
|
when "create_internal"
|
@@ -431,13 +442,11 @@ Static Network Configuration
|
|
431
442
|
raise MiqSignalError
|
432
443
|
elsif message_server.ask_questions && message_server.configure
|
433
444
|
say("\nMessage Server configured successfully.\n")
|
434
|
-
press_any_key
|
435
445
|
else
|
436
446
|
say("\nMessage Server configuration failed!\n")
|
437
447
|
press_any_key
|
438
448
|
raise MiqSignalError
|
439
449
|
end
|
440
|
-
|
441
450
|
when "message_client"
|
442
451
|
say("#{selection}\n\n")
|
443
452
|
|
@@ -448,7 +457,6 @@ Static Network Configuration
|
|
448
457
|
raise MiqSignalError
|
449
458
|
elsif message_client.ask_questions && message_client.configure
|
450
459
|
say("\nMessage Client configured successfully.\n")
|
451
|
-
press_any_key
|
452
460
|
else
|
453
461
|
say("\nMessage Client configuration failed!\n")
|
454
462
|
press_any_key
|
@@ -456,6 +464,12 @@ Static Network Configuration
|
|
456
464
|
end
|
457
465
|
end
|
458
466
|
|
467
|
+
# Start evmserverd if database and/or messaging were set up and we are supposed to run as an evmserver
|
468
|
+
if changes_requested && database_configuration.run_as_evm_server
|
469
|
+
say("\nStarting #{I18n.t("product.name")} Server...")
|
470
|
+
ManageIQ::ApplianceConsole::EvmServer.start
|
471
|
+
end
|
472
|
+
|
459
473
|
press_any_key
|
460
474
|
|
461
475
|
when I18n.t("advanced_settings.db_replication")
|
@@ -553,13 +567,13 @@ Static Network Configuration
|
|
553
567
|
when RE_RESTART
|
554
568
|
if are_you_sure?("restart the appliance now")
|
555
569
|
logger.info("Appliance restart initiated by appliance console.")
|
556
|
-
|
570
|
+
ManageIQ::ApplianceConsole::EvmServer.stop
|
557
571
|
LinuxAdmin::System.reboot!
|
558
572
|
end
|
559
573
|
when RE_DELLOGS
|
560
574
|
if are_you_sure?("restart the appliance now")
|
561
575
|
logger.info("Appliance restart with clean logs initiated by appliance console.")
|
562
|
-
|
576
|
+
ManageIQ::ApplianceConsole::EvmServer.stop
|
563
577
|
LinuxAdmin::Service.new("miqtop").stop
|
564
578
|
LinuxAdmin::Service.new("miqvmstat").stop
|
565
579
|
LinuxAdmin::Service.new("httpd").stop
|
@@ -575,7 +589,7 @@ Static Network Configuration
|
|
575
589
|
if are_you_sure?("shut down the appliance now")
|
576
590
|
say("\nShutting down appliance... This process may take a few minutes.\n\n")
|
577
591
|
logger.info("Appliance shutdown initiated by appliance console")
|
578
|
-
|
592
|
+
ManageIQ::ApplianceConsole::EvmServer.stop
|
579
593
|
LinuxAdmin::System.shutdown!
|
580
594
|
end
|
581
595
|
|
@@ -529,15 +529,13 @@ module ApplianceConsole
|
|
529
529
|
end
|
530
530
|
|
531
531
|
def set_server_state
|
532
|
-
service = LinuxAdmin::Service.new("evmserverd")
|
533
|
-
service_running = service.running?
|
534
532
|
case options[:server]
|
535
533
|
when "start"
|
536
|
-
|
534
|
+
EvmServer.start unless EvmServer.running?
|
537
535
|
when "stop"
|
538
|
-
|
536
|
+
EvmServer.stop if EvmServer.running?
|
539
537
|
when "restart"
|
540
|
-
|
538
|
+
EvmServer.restart
|
541
539
|
else
|
542
540
|
raise "Invalid server action"
|
543
541
|
end
|
@@ -38,7 +38,7 @@ module ManageIQ
|
|
38
38
|
|
39
39
|
def ask_questions
|
40
40
|
setting_header
|
41
|
-
if action == :restore &&
|
41
|
+
if action == :restore && EvmServer.running?
|
42
42
|
say("\nDatabase restore failed. Please execute the \“Stop EVM Server Processes\” command and try again.")
|
43
43
|
press_any_key
|
44
44
|
raise MiqSignalError
|
@@ -12,7 +12,7 @@ module ApplianceConsole
|
|
12
12
|
class DatabaseConfiguration
|
13
13
|
include ManageIQ::ApplianceConsole::ManageiqUserMixin
|
14
14
|
|
15
|
-
attr_accessor :adapter, :host, :username, :database, :port, :region
|
15
|
+
attr_accessor :adapter, :host, :username, :database, :port, :region, :run_as_evm_server
|
16
16
|
attr_reader :password
|
17
17
|
|
18
18
|
class ModelWithNoBackingTable < ActiveRecord::Base
|
@@ -38,6 +38,7 @@ module ApplianceConsole
|
|
38
38
|
@adapter ||= "postgresql"
|
39
39
|
# introduced by Logging
|
40
40
|
self.interactive = true unless hash.key?(:interactive)
|
41
|
+
self.run_as_evm_server = true unless hash.key?(:run_as_evm_server)
|
41
42
|
end
|
42
43
|
|
43
44
|
def run_interactive
|
@@ -48,7 +49,6 @@ module ApplianceConsole
|
|
48
49
|
|
49
50
|
raise MiqSignalError unless activate
|
50
51
|
|
51
|
-
post_activation
|
52
52
|
say("\nConfiguration activated successfully.\n")
|
53
53
|
rescue RuntimeError => e
|
54
54
|
puts "Configuration failed#{": " + e.message unless e.class == MiqSignalError}"
|
@@ -236,18 +236,6 @@ FRIENDLY
|
|
236
236
|
end
|
237
237
|
end
|
238
238
|
|
239
|
-
def start_evm
|
240
|
-
pid = fork do
|
241
|
-
begin
|
242
|
-
LinuxAdmin::Service.new("evmserverd").start(true)
|
243
|
-
rescue => e
|
244
|
-
logger.error("Failed to enable and start evmserverd service: #{e.message}")
|
245
|
-
logger.error(e.backtrace.join("\n"))
|
246
|
-
end
|
247
|
-
end
|
248
|
-
Process.detach(pid)
|
249
|
-
end
|
250
|
-
|
251
239
|
private
|
252
240
|
|
253
241
|
def self.rails_env
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module ManageIQ
|
2
|
+
module ApplianceConsole
|
3
|
+
class EvmServer
|
4
|
+
class NotRunnableError < RuntimeError; end
|
5
|
+
|
6
|
+
class << self
|
7
|
+
def running?
|
8
|
+
service.running?
|
9
|
+
end
|
10
|
+
|
11
|
+
def start!(enable: false)
|
12
|
+
raise NotRunnableError, "Cannot start #{I18n.t("product.name")}: #{not_runnable_reason}" unless runnable?
|
13
|
+
|
14
|
+
service.start(enable)
|
15
|
+
end
|
16
|
+
|
17
|
+
def start(enable: false)
|
18
|
+
start!(:enable => enable)
|
19
|
+
rescue AwesomeSpawn::CommandResultError => e
|
20
|
+
say(e.result.output)
|
21
|
+
say(e.result.error)
|
22
|
+
say("")
|
23
|
+
false
|
24
|
+
rescue NotRunnableError => e
|
25
|
+
say(e.to_s)
|
26
|
+
say("")
|
27
|
+
false
|
28
|
+
end
|
29
|
+
|
30
|
+
def stop
|
31
|
+
service.stop
|
32
|
+
end
|
33
|
+
|
34
|
+
def restart
|
35
|
+
service.restart
|
36
|
+
end
|
37
|
+
|
38
|
+
def enable
|
39
|
+
service.enable
|
40
|
+
end
|
41
|
+
|
42
|
+
def disable
|
43
|
+
service.disable
|
44
|
+
end
|
45
|
+
|
46
|
+
def runnable?
|
47
|
+
DatabaseConfiguration.database_yml_configured? && MessageConfiguration.configured?
|
48
|
+
end
|
49
|
+
|
50
|
+
def not_runnable_reason
|
51
|
+
if !DatabaseConfiguration.database_yml_configured?
|
52
|
+
"A Database connection has not been configured."
|
53
|
+
elsif !MessageConfiguration.configured?
|
54
|
+
"Messaging has not been configured."
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
private
|
59
|
+
|
60
|
+
def service
|
61
|
+
@service ||= LinuxAdmin::Service.new("evmserverd")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -5,7 +5,7 @@ require "linux_admin"
|
|
5
5
|
module ManageIQ
|
6
6
|
module ApplianceConsole
|
7
7
|
class InternalDatabaseConfiguration < DatabaseConfiguration
|
8
|
-
attr_accessor :disk
|
8
|
+
attr_accessor :disk
|
9
9
|
|
10
10
|
DEDICATED_DB_SHARED_BUFFERS = "'1GB'".freeze
|
11
11
|
SHARED_DB_SHARED_BUFFERS = "'128MB'".freeze
|
@@ -24,10 +24,9 @@ module ApplianceConsole
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def set_defaults
|
27
|
-
self.host
|
28
|
-
self.username
|
29
|
-
self.database
|
30
|
-
self.run_as_evm_server = true
|
27
|
+
self.host = 'localhost'
|
28
|
+
self.username = "root"
|
29
|
+
self.database = "vmdb_production"
|
31
30
|
end
|
32
31
|
|
33
32
|
def activate
|
@@ -109,10 +108,6 @@ module ApplianceConsole
|
|
109
108
|
copy_template "pg_ident.conf"
|
110
109
|
end
|
111
110
|
|
112
|
-
def post_activation
|
113
|
-
start_evm if run_as_evm_server
|
114
|
-
end
|
115
|
-
|
116
111
|
private
|
117
112
|
|
118
113
|
def mount_point
|
@@ -20,7 +20,7 @@ module ApplianceConsole
|
|
20
20
|
|
21
21
|
self.size = Utilities.disk_usage(LOGFILE_DIRECTORY)[0][:total_bytes]
|
22
22
|
self.current_logrotate_count = /rotate\s+(\d+)/.match(File.read(MIQ_LOGS_CONF))[1]
|
23
|
-
self.evm_was_running =
|
23
|
+
self.evm_was_running = EvmServer.running?
|
24
24
|
end
|
25
25
|
|
26
26
|
def activate
|
@@ -103,13 +103,13 @@ module ApplianceConsole
|
|
103
103
|
|
104
104
|
def start_evm
|
105
105
|
say 'Starting EVM'
|
106
|
-
|
106
|
+
EvmServer.start(:enable => true)
|
107
107
|
LinuxAdmin::Service.new("httpd").enable.start
|
108
108
|
end
|
109
109
|
|
110
110
|
def stop_evm
|
111
111
|
say 'Stopping EVM'
|
112
|
-
|
112
|
+
EvmServer.stop
|
113
113
|
LinuxAdmin::Service.new("httpd").stop
|
114
114
|
end
|
115
115
|
end
|
@@ -26,6 +26,10 @@ module ManageIQ
|
|
26
26
|
File.exist?("#{BASE_DIR}/bin/kafka-run-class.sh")
|
27
27
|
end
|
28
28
|
|
29
|
+
def self.configured?
|
30
|
+
MessageServerConfiguration.configured? || MessageClientConfiguration.configured?
|
31
|
+
end
|
32
|
+
|
29
33
|
def initialize(options = {})
|
30
34
|
@message_server_port = options[:message_server_port] || 9093
|
31
35
|
@message_keystore_username = options[:message_keystore_username] || "admin"
|
@@ -108,20 +112,16 @@ module ManageIQ
|
|
108
112
|
|
109
113
|
messaging_yaml = YAML.load_file(messaging_yaml_sample_path)
|
110
114
|
|
111
|
-
messaging_yaml["production"]
|
112
|
-
messaging_yaml["production"]
|
113
|
-
|
114
|
-
messaging_yaml["production"]["
|
115
|
-
messaging_yaml["production"]["port"] = message_server_port
|
116
|
-
messaging_yaml["production"]["sasl.mechanism"] = "PLAIN"
|
117
|
-
messaging_yaml["production"]["sasl.username"] = message_keystore_username
|
118
|
-
messaging_yaml["production"]["sasl.password"] = ManageIQ::Password.try_encrypt(message_keystore_password)
|
115
|
+
messaging_yaml["production"]["host"] = message_server_host
|
116
|
+
messaging_yaml["production"]["port"] = message_server_port
|
117
|
+
messaging_yaml["production"]["username"] = message_keystore_username
|
118
|
+
messaging_yaml["production"]["password"] = ManageIQ::Password.try_encrypt(message_keystore_password)
|
119
119
|
|
120
120
|
if secure?
|
121
|
-
messaging_yaml["production"]["
|
122
|
-
messaging_yaml["production"]["
|
121
|
+
messaging_yaml["production"]["ssl"] = true
|
122
|
+
messaging_yaml["production"]["ca_file"] = ca_cert_path.to_path
|
123
123
|
else
|
124
|
-
messaging_yaml["production"]["
|
124
|
+
messaging_yaml["production"]["ssl"] = false
|
125
125
|
end
|
126
126
|
|
127
127
|
File.open(messaging_yaml_path, "w") do |f|
|
@@ -183,21 +183,7 @@ module ManageIQ
|
|
183
183
|
true
|
184
184
|
end
|
185
185
|
|
186
|
-
def configure_messaging_type(value)
|
187
|
-
say(__method__.to_s.tr("_", " ").titleize)
|
188
|
-
|
189
|
-
ManageIQ::ApplianceConsole::Utilities.rake_run!("evm:settings:set", ["/prototype/messaging_type=#{value}"])
|
190
|
-
end
|
191
|
-
|
192
|
-
def restart_evmserverd
|
193
|
-
say("Restart evmserverd if it is running...")
|
194
|
-
evmserverd_service = LinuxAdmin::Service.new("evmserverd")
|
195
|
-
evmserverd_service.restart if evmserverd_service.running?
|
196
|
-
end
|
197
|
-
|
198
186
|
def unconfigure
|
199
|
-
configure_messaging_type("miq_queue") # Settings.prototype.messaging_type = 'miq_queue'
|
200
|
-
restart_evmserverd
|
201
187
|
remove_installed_files
|
202
188
|
end
|
203
189
|
|
@@ -29,8 +29,6 @@ module ManageIQ
|
|
29
29
|
configure_messaging_yaml # Set up the local message client in case EVM is actually running on this, Message Server
|
30
30
|
create_client_properties # Create the client.properties configuration fle
|
31
31
|
fetch_truststore_from_server # Fetch the Java Keystore from the Kafka Server
|
32
|
-
configure_messaging_type("kafka") # Settings.prototype.messaging_type = 'kafka'
|
33
|
-
restart_evmserverd
|
34
32
|
rescue AwesomeSpawn::CommandResultError => e
|
35
33
|
say(e.result.output)
|
36
34
|
say(e.result.error)
|
@@ -77,6 +75,10 @@ module ManageIQ
|
|
77
75
|
fetch_from_server(message_ca_cert_path_src, ca_cert_path)
|
78
76
|
end
|
79
77
|
|
78
|
+
def self.configured?
|
79
|
+
MessageClientConfiguration.new.installed_files.all? { |f| File.exist?(f) }
|
80
|
+
end
|
81
|
+
|
80
82
|
private
|
81
83
|
|
82
84
|
def fetch_from_server(src_file, dst_file)
|
@@ -43,7 +43,6 @@ module ManageIQ
|
|
43
43
|
configure_keystore # Populate the Java Keystore
|
44
44
|
create_server_properties # Update the /opt/message/config/server.properties
|
45
45
|
configure_messaging_yaml # Set up the local message client in case EVM is actually running on this, Message Server
|
46
|
-
configure_messaging_type("kafka") # Settings.prototype.messaging_type = 'kafka'
|
47
46
|
restart_services
|
48
47
|
rescue AwesomeSpawn::CommandResultError => e
|
49
48
|
say(e.result.output)
|
@@ -64,14 +63,17 @@ module ManageIQ
|
|
64
63
|
|
65
64
|
say("Starting kafka and configure it to start on reboots ...")
|
66
65
|
LinuxAdmin::Service.new("kafka").start.enable
|
67
|
-
|
68
|
-
restart_evmserverd
|
69
66
|
end
|
70
67
|
|
71
68
|
def ask_for_parameters
|
72
69
|
say("\nMessage Server Parameters:\n\n")
|
73
70
|
|
74
71
|
@message_server_host = ask_for_string("Message Server Hostname or IP address", message_server_host)
|
72
|
+
|
73
|
+
# SSL Validation for Kafka does not work for hostnames containing "localhost"
|
74
|
+
# Therefore we replace with the equivalent IP "127.0.0.1" if a /localhost*/ hostname was entered
|
75
|
+
@message_server_host = "127.0.0.1" if @message_server_host.include?("localhost")
|
76
|
+
|
75
77
|
@message_keystore_username = ask_for_string("Message Keystore Username", message_keystore_username)
|
76
78
|
@message_keystore_password = ask_for_password("Message Keystore Password")
|
77
79
|
@message_persistent_disk = ask_for_persistent_disk
|
@@ -27,8 +27,13 @@ module ApplianceConsole
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.db_connections
|
30
|
+
# TODO: this is impossible to test right now because we need to shell out and run our rails app which isn't a direct dependency here.
|
31
|
+
# We have the settings from the database_configuration, so we should pass them here and simplify this and make it testable.
|
32
|
+
# Basically, we're doing a lot of work to run this 1 query:
|
33
|
+
# psql -U username -h host postgres -c "select count(*) from pg_stat_activity where datname = 'vmdb_production';"
|
34
|
+
# We shouldn't need to subtract our 1 "connection" in "bail_if_db_connections" if we connect to the postgres db.
|
30
35
|
code = [
|
31
|
-
"database ||= ActiveRecord::Base.configurations
|
36
|
+
"database ||= ActiveRecord::Base.configurations.configs_for(:env_name => Rails.env).first.database",
|
32
37
|
"conn = ActiveRecord::Base.connection",
|
33
38
|
"exit conn.client_connections.count { |c| c['database'] == database }"
|
34
39
|
]
|
@@ -34,6 +34,7 @@ require 'manageiq/appliance_console/database_replication_standby'
|
|
34
34
|
require 'manageiq/appliance_console/external_auth_options'
|
35
35
|
require 'manageiq/appliance_console/external_database_configuration'
|
36
36
|
require 'manageiq/appliance_console/external_httpd_authentication'
|
37
|
+
require 'manageiq/appliance_console/evm_server'
|
37
38
|
require 'manageiq/appliance_console/internal_database_configuration'
|
38
39
|
require 'manageiq/appliance_console/key_configuration'
|
39
40
|
require 'manageiq/appliance_console/logfile_configuration'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: manageiq-appliance_console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ManageIQ Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -346,6 +346,7 @@ files:
|
|
346
346
|
- ".travis.yml"
|
347
347
|
- ".whitesource"
|
348
348
|
- ".yamllint"
|
349
|
+
- CHANGELOG.md
|
349
350
|
- Gemfile
|
350
351
|
- LICENSE.txt
|
351
352
|
- README.md
|
@@ -363,6 +364,7 @@ files:
|
|
363
364
|
- lib/manageiq/appliance_console/database_replication_primary.rb
|
364
365
|
- lib/manageiq/appliance_console/database_replication_standby.rb
|
365
366
|
- lib/manageiq/appliance_console/errors.rb
|
367
|
+
- lib/manageiq/appliance_console/evm_server.rb
|
366
368
|
- lib/manageiq/appliance_console/external_auth_options.rb
|
367
369
|
- lib/manageiq/appliance_console/external_database_configuration.rb
|
368
370
|
- lib/manageiq/appliance_console/external_httpd_authentication.rb
|
@@ -410,7 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
410
412
|
- !ruby/object:Gem::Version
|
411
413
|
version: '0'
|
412
414
|
requirements: []
|
413
|
-
rubygems_version: 3.3.
|
415
|
+
rubygems_version: 3.3.15
|
414
416
|
signing_key:
|
415
417
|
specification_version: 4
|
416
418
|
summary: ManageIQ Appliance Console
|