manageiq-appliance_console 7.1.1 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a87349bf14d9211aa40088c39668407f50545de717a9da552e74430a44750e5
4
- data.tar.gz: 4f3a63c811e3e0e4db435fa96a476c8d5988cd4b70eab125abe5fa0a9812c976
3
+ metadata.gz: 81ef1030034c190aa4fc241853afd0f5e40395b4fd8d94b9c0782253462c8d71
4
+ data.tar.gz: 28d2102f5ff3b9248db6856b2da027b8562f0481292f7d28ddbae3ce91fb4f21
5
5
  SHA512:
6
- metadata.gz: e620e0826634427b14394181875562130e9997d7969fd8a6886124b2b1ba5d61f936a293b37c886b771e3f4f1d5529150dfe2a65ed12a3dd753bfe7f2c2ee3ad
7
- data.tar.gz: b17e8214b2a508c01107281d1177517af80c839fbb1cc64ec5cff696383029b11e54319eac18078a324ec2e04bec7e9bd90d3a9f9d6855ef1979fbd2d63ed480
6
+ metadata.gz: 4e563cc050899e2b62e8bc3546664d3c28c3abbb0979328fa0125c4e38ef9910553f938a317d144238205c2c76e98dc3de7ef963e3ac8e80f7f8761cc117fe0c
7
+ data.tar.gz: 524948a3576e46b19de0fb94f1248d16805e4d4dec94b5e29730e72065dd266edad5f76db73b94165c33b7de289208421e8d153a0cf24a013c1064452e9b834c
@@ -431,7 +431,6 @@ Static Network Configuration
431
431
  raise MiqSignalError
432
432
  elsif message_server.ask_questions && message_server.configure
433
433
  say("\nMessage Server configured successfully.\n")
434
- press_any_key
435
434
  else
436
435
  say("\nMessage Server configuration failed!\n")
437
436
  press_any_key
@@ -448,7 +447,6 @@ Static Network Configuration
448
447
  raise MiqSignalError
449
448
  elsif message_client.ask_questions && message_client.configure
450
449
  say("\nMessage Client configured successfully.\n")
451
- press_any_key
452
450
  else
453
451
  say("\nMessage Client configuration failed!\n")
454
452
  press_any_key
@@ -7,11 +7,20 @@ module ApplianceConsole
7
7
  class DatabaseReplication
8
8
  include ManageIQ::ApplianceConsole::Logging
9
9
 
10
- REPMGR_CONFIG = '/etc/repmgr/10/repmgr.conf'.freeze
11
- REPMGR_LOG = '/var/log/repmgr/repmgrd.log'.freeze
12
10
  PGPASS_FILE = '/var/lib/pgsql/.pgpass'.freeze
13
11
  NETWORK_INTERFACE = 'eth0'.freeze
14
12
 
13
+ REPGMR_FILE_LOCATIONS = {
14
+ "repmgr10" => {
15
+ "config" => "/etc/repmgr/10/repmgr.conf",
16
+ "log" => "/var/log/repmgr/repmgrd.log"
17
+ },
18
+ "repmgr13" => {
19
+ "config" => "/etc/repmgr/13/repmgr.conf",
20
+ "log" => "/var/log/repmgr/repmgrd-13.log"
21
+ }
22
+ }.freeze
23
+
15
24
  attr_accessor :node_number, :database_name, :database_user,
16
25
  :database_password, :primary_host
17
26
 
@@ -37,33 +46,53 @@ Replication Server Configuration
37
46
  EOL
38
47
  end
39
48
 
40
- def repmgr_configured?
41
- File.exist?(REPMGR_CONFIG)
49
+ def self.repmgr_config
50
+ repmgr_file_locations["config"]
51
+ end
52
+
53
+ def self.repmgr_configured?
54
+ File.exist?(repmgr_config)
55
+ end
56
+
57
+ def self.repmgr_file_locations
58
+ REPGMR_FILE_LOCATIONS[repmgr_service_name]
42
59
  end
43
60
 
61
+ def self.repmgr_log
62
+ repmgr_file_locations["log"]
63
+ end
64
+
65
+ def self.repmgr_service_name
66
+ @repmgr_service_name ||= File.exist?(REPGMR_FILE_LOCATIONS["repmgr13"]["config"]) ? "repmgr13" : "repmgr10"
67
+ end
68
+
69
+ delegate :repmgr_config, :repmgr_configured?, :repmgr_file_locations, :repmgr_log, :repmgr_service_name, :to => self
70
+
44
71
  def confirm_reconfiguration
45
- say("Warning: File #{REPMGR_CONFIG} exists. Replication is already configured")
46
- logger.warn("Warning: File #{REPMGR_CONFIG} exists. Replication is already configured")
72
+ say("Warning: File #{repmgr_config} exists. Replication is already configured")
73
+ logger.warn("Warning: File #{repmgr_config} exists. Replication is already configured")
47
74
  agree("Continue with configuration? (Y/N): ")
48
75
  end
49
76
 
50
77
  def create_config_file(host)
51
- File.write(REPMGR_CONFIG, config_file_contents(host))
78
+ File.write(repmgr_config, config_file_contents(host))
52
79
  true
53
80
  end
54
81
 
55
82
  def config_file_contents(host)
56
83
  service_name = PostgresAdmin.service_name
84
+ # FYI, 5.0 made quoting strings strict. Always use single quoted strings.
85
+ # https://repmgr.org/docs/current/release-5.0.html
57
86
  <<-EOS.strip_heredoc
58
- node_id=#{node_number}
59
- node_name=#{host}
87
+ node_id='#{node_number}'
88
+ node_name='#{host}'
60
89
  conninfo='host=#{host} user=#{database_user} dbname=#{database_name}'
61
- use_replication_slots=1
90
+ use_replication_slots='1'
62
91
  pg_basebackup_options='--wal-method=stream'
63
- failover=automatic
64
- promote_command='repmgr standby promote -f #{REPMGR_CONFIG} --log-to-file'
65
- follow_command='repmgr standby follow -f #{REPMGR_CONFIG} --log-to-file --upstream-node-id=%n'
66
- log_file=#{REPMGR_LOG}
92
+ failover='automatic'
93
+ promote_command='repmgr standby promote -f #{repmgr_config} --log-to-file'
94
+ follow_command='repmgr standby follow -f #{repmgr_config} --log-to-file --upstream-node-id=%n'
95
+ log_file='#{repmgr_log}'
67
96
  service_start_command='sudo systemctl start #{service_name}'
68
97
  service_stop_command='sudo systemctl stop #{service_name}'
69
98
  service_restart_command='sudo systemctl restart #{service_name}'
@@ -8,7 +8,6 @@ module ApplianceConsole
8
8
  include ManageIQ::ApplianceConsole::Logging
9
9
 
10
10
  REGISTER_CMD = 'repmgr standby register'.freeze
11
- REPMGRD_SERVICE = 'repmgr10'.freeze
12
11
 
13
12
  attr_accessor :disk, :standby_host, :run_repmgrd_configuration, :resync_data, :force_register
14
13
 
@@ -111,7 +110,7 @@ module ApplianceConsole
111
110
  end
112
111
 
113
112
  def start_repmgrd
114
- LinuxAdmin::Service.new(REPMGRD_SERVICE).enable.start
113
+ LinuxAdmin::Service.new(repmgr_service_name).enable.start
115
114
  true
116
115
  rescue AwesomeSpawn::CommandResultError => e
117
116
  message = "Failed to start repmgrd: #{e.message}"
@@ -121,7 +120,7 @@ module ApplianceConsole
121
120
  end
122
121
 
123
122
  def stop_repmgrd
124
- LinuxAdmin::Service.new(REPMGRD_SERVICE).stop
123
+ LinuxAdmin::Service.new(repmgr_service_name).stop
125
124
  true
126
125
  end
127
126
 
@@ -108,20 +108,16 @@ module ManageIQ
108
108
 
109
109
  messaging_yaml = YAML.load_file(messaging_yaml_sample_path)
110
110
 
111
- messaging_yaml["production"].delete("username")
112
- messaging_yaml["production"].delete("password")
113
-
114
- messaging_yaml["production"]["hostname"] = message_server_host
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)
111
+ messaging_yaml["production"]["host"] = message_server_host
112
+ messaging_yaml["production"]["port"] = message_server_port
113
+ messaging_yaml["production"]["username"] = message_keystore_username
114
+ messaging_yaml["production"]["password"] = ManageIQ::Password.try_encrypt(message_keystore_password)
119
115
 
120
116
  if secure?
121
- messaging_yaml["production"]["security.protocol"] = "SASL_SSL"
122
- messaging_yaml["production"]["ssl.ca.location"] = ca_cert_path.to_path
117
+ messaging_yaml["production"]["ssl"] = true
118
+ messaging_yaml["production"]["ca_file"] = ca_cert_path.to_path
123
119
  else
124
- messaging_yaml["production"]["security.protocol"] = "PLAINTEXT"
120
+ messaging_yaml["production"]["ssl"] = false
125
121
  end
126
122
 
127
123
  File.open(messaging_yaml_path, "w") do |f|
@@ -72,6 +72,11 @@ module ManageIQ
72
72
  say("\nMessage Server Parameters:\n\n")
73
73
 
74
74
  @message_server_host = ask_for_string("Message Server Hostname or IP address", message_server_host)
75
+
76
+ # SSL Validation for Kafka does not work for hostnames containing "localhost"
77
+ # Therefore we replace with the equivalent IP "127.0.0.1" if a /localhost*/ hostname was entered
78
+ @message_server_host = "127.0.0.1" if @message_server_host.include?("localhost")
79
+
75
80
  @message_keystore_username = ask_for_string("Message Keystore Username", message_keystore_username)
76
81
  @message_keystore_password = ask_for_password("Message Keystore Password")
77
82
  @message_persistent_disk = ask_for_persistent_disk
@@ -62,13 +62,18 @@ module ApplianceConsole
62
62
  LinuxAdmin::Service.new(service_name).running?
63
63
  end
64
64
 
65
- def self.local_server_in_recovery?
66
- data_directory.join("recovery.conf").exist?
65
+ def self.local_server_received_standby_signal?
66
+ # Beginning with PostgreSQL 12, replication configuration has been integrated into the main PostgreSQL configuraton system and the conventional recovery.conf file is no longer valid.
67
+ # see: https://repmgr.org/docs/current/release-5.0.html
68
+ # https://www.2ndquadrant.com/en/blog/replication-configuration-changes-in-postgresql-12/
69
+ # "standby.signal" – indicates the server should start up as a hot standby
70
+ # If a standby is promoted, "standby.signal" is removed entirely (and not renamed as was the case with "recovery.conf", which became "recovery.done").
71
+ data_directory.join("standby.signal").exist? || data_directory.join("recovery.conf").exist?
67
72
  end
68
73
 
69
74
  def self.local_server_status
70
75
  if service_running?
71
- "running (#{local_server_in_recovery? ? "standby" : "primary"})"
76
+ "running (#{local_server_received_standby_signal? ? "standby" : "primary"})"
72
77
  elsif initialized?
73
78
  "initialized and stopped"
74
79
  else
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module ApplianceConsole
3
- VERSION = '7.1.1'.freeze
3
+ VERSION = '7.2.0'.freeze
4
4
  end
5
5
  end
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: 7.1.1
4
+ version: 7.2.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-09-02 00:00:00.000000000 Z
11
+ date: 2022-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -410,7 +410,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
410
  - !ruby/object:Gem::Version
411
411
  version: '0'
412
412
  requirements: []
413
- rubygems_version: 3.3.18
413
+ rubygems_version: 3.3.15
414
414
  signing_key:
415
415
  specification_version: 4
416
416
  summary: ManageIQ Appliance Console