manageiq-appliance_console 2.0.1 → 2.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f188ab603867069d87c287bd0176594c92540fef4f12fd730a61df217168d46c
4
- data.tar.gz: 3f4c1066c3e2889d34f60976438182e91e8129557b8ac19ba4f1d481b28385d6
3
+ metadata.gz: '01151816500b80c49674ed6063ce8af2b732da048bcbcf3b39e4462acd6cc5fd'
4
+ data.tar.gz: 8ec934a3b7a9a6b350b295bec3a1e4c03c9e51ad2f8ba57cdedb3c032de51455
5
5
  SHA512:
6
- metadata.gz: 8ce788e513a9732a2f2095e996506a0ae3b693ae274a9dac83c9ee856084b394cbfa72666e274fbaf985cad6ed288ecaec88ddc935f31c8937a0160b10cb0f74
7
- data.tar.gz: 8368a4fcebfd4904f46b6f8970916fcbeaa12dea4322b93b5f299ffad43e2fc06e6c952c266c765e288236d5e86a3f57f89a0ced5b55652f53b4cddf6a5d6392
6
+ metadata.gz: 1e333fea67f0f233844fef49a344b3eccdf9c30011938768b9dcea61666a35573d5e51e98bb10ee656985d6284f24a384a3c0fdb7171b21dc7c34db34d45d479
7
+ data.tar.gz: 01b0b87561bcfc018ce5eb487346878d167101579de130545bbc235b17eab6a0c1b0143796fd13e0352d15d7ea3c25e825303134e6436f6dbb198fd5f6fea2d6
@@ -73,6 +73,24 @@ CLOUD_INIT_DISABLE_NETWORK_CONFIG = "network: {config: disabled}\n".freeze
73
73
 
74
74
  module ManageIQ
75
75
  module ApplianceConsole
76
+ def ensure_key_configured
77
+ key_config = ManageIQ::ApplianceConsole::KeyConfiguration.new
78
+ unless key_config.key_exist?
79
+ say "No encryption key found.\n"
80
+ say "For migrations, copy encryption key from a hardened appliance."
81
+ say "For worker and multi-region setups, copy key from another appliance.\n"
82
+ say "If this is your first appliance, just generate one now.\n\n"
83
+
84
+ if key_config.ask_question_loop
85
+ say("\nEncryption key now configured.\n\n")
86
+ else
87
+ say("\nEncryption key not configured.")
88
+ press_any_key
89
+ raise MiqSignalError
90
+ end
91
+ end
92
+ end
93
+
76
94
  eth0 = LinuxAdmin::NetworkInterface.new(NETWORK_INTERFACE)
77
95
  # Because it takes a few seconds, get the region once in the outside loop
78
96
  region = ManageIQ::ApplianceConsole::DatabaseConfiguration.region
@@ -457,21 +475,7 @@ Static Network Configuration
457
475
  when I18n.t("advanced_settings.db_config")
458
476
  say("#{selection}\n\n")
459
477
 
460
- key_config = ManageIQ::ApplianceConsole::KeyConfiguration.new
461
- unless key_config.key_exist?
462
- say "No encryption key found.\n"
463
- say "For migrations, copy encryption key from a hardened appliance."
464
- say "For worker and multi-region setups, copy key from another appliance.\n"
465
- say "If this is your first appliance, just generate one now.\n\n"
466
-
467
- if key_config.ask_question_loop
468
- say("\nEncryption key now configured.\n\n")
469
- else
470
- say("\nEncryption key not configured.")
471
- press_any_key
472
- raise MiqSignalError
473
- end
474
- end
478
+ ensure_key_configured
475
479
 
476
480
  options = {
477
481
  "Create Internal Database" => "create_internal",
@@ -524,6 +528,7 @@ Static Network Configuration
524
528
  when "standby"
525
529
  db_replication = ManageIQ::ApplianceConsole::DatabaseReplicationStandby.new
526
530
  logger.info("Configuring Server as Standby")
531
+ ensure_key_configured
527
532
  end
528
533
 
529
534
  if db_replication.ask_questions && db_replication.activate
@@ -63,6 +63,7 @@ module ApplianceConsole
63
63
  stop_repmgrd
64
64
  initialize_postgresql_disk if disk
65
65
  PostgresAdmin.prep_data_directory if disk || resync_data
66
+ save_database_yml
66
67
  generate_cluster_name &&
67
68
  create_config_file(standby_host) &&
68
69
  clone_standby_server &&
@@ -143,6 +144,10 @@ module ApplianceConsole
143
144
 
144
145
  private
145
146
 
147
+ def save_database_yml
148
+ InternalDatabaseConfiguration.new(:password => database_password).save
149
+ end
150
+
146
151
  def record_for_node_number
147
152
  c = PG::Connection.new(primary_connection_hash)
148
153
  c.exec_params(<<-SQL, [node_number]).map_types!(PG::BasicTypeMapForResults.new(c)).first
@@ -41,7 +41,7 @@ module ApplianceConsole
41
41
  end
42
42
  initialize_postgresql_disk if disk
43
43
  initialize_postgresql
44
- return super if run_as_evm_server
44
+ run_as_evm_server ? (return super) : save
45
45
  true
46
46
  end
47
47
 
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module ApplianceConsole
3
- VERSION = '2.0.1'.freeze
3
+ VERSION = '2.0.2'.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: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-25 00:00:00.000000000 Z
11
+ date: 2018-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord