Skip to content

Commit 2d0060d

Browse files
authored
Merge pull request #699 from globocom/fix-reinstallvm-mongodb-with-ssl
steps for create ssl when reinstall arbiter instance
2 parents 8437cee + 51a7f96 commit 2d0060d

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

dbaas/drivers/replication_topologies/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,16 @@ def get_reinstallvm_steps(self):
348348
'workflow.steps.util.plan.ConfigureLog',
349349
'workflow.steps.util.metric_collector.ConfigureTelegraf',
350350
) + self.get_change_binaries_upgrade_patch_steps() + (
351+
) + self.get_reinstallvm_ssl_steps() + (
351352
'workflow.steps.util.database.Start',
352353
'workflow.steps.util.database.CheckIsUp',
353354
'workflow.steps.util.metric_collector.RestartTelegraf',
354355
),
355356
}] + self.get_reinstallvm_steps_final()
356357

358+
def get_reinstallvm_ssl_steps(self):
359+
return ()
360+
357361
def get_reinstallvm_steps_final(self):
358362
return [{
359363
'Enabling monitoring and alarms': (

dbaas/drivers/replication_topologies/mongodb.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,18 @@ def get_database_migrate_steps_stage_3(self):
11681168
'workflow.steps.util.host_provider.DestroyServiceAccountMigrate',
11691169
)}]
11701170

1171+
def get_reinstallvm_ssl_steps(self):
1172+
return (
1173+
'workflow.steps.util.ssl.UpdateOpenSSlLibIfConfiguredArbiterOnly',
1174+
'workflow.steps.util.ssl.MongoDBUpdateCertificatesIfConfiguredArbiterOnly',
1175+
'workflow.steps.util.ssl.CreateSSLFolderIfConfiguredArbiterOnly',
1176+
'workflow.steps.util.ssl.MongoDBCreateSSLConfForInfraIPIfConfiguredArbiterOnly',
1177+
'workflow.steps.util.ssl.RequestSSLForInfraIfConfiguredArbiterOnly',
1178+
'workflow.steps.util.ssl.CreateJsonRequestFileInfraIfConfiguredArbiterOnly',
1179+
'workflow.steps.util.ssl.CreateCertificateInfraMongoDBIfConfiguredArbiterOnly',
1180+
'workflow.steps.util.ssl.SetSSLFilesAccessMongoDBIfConfiguredArbiterOnly',
1181+
)
1182+
11711183

11721184
class MongoDBReplicaset40(MongoDBReplicaset):
11731185

dbaas/workflow/steps/util/ssl.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,3 +861,43 @@ def do(self):
861861
if self.plan.is_ha:
862862
self.client.admin.command(
863863
'setParameter', 1, clusterAuthMode='x509')
864+
865+
866+
class ReinstallVMSSLArbiterOnly(IfConguredSSLValidator):
867+
@property
868+
def is_valid(self):
869+
if self.is_database_instance:
870+
return False
871+
return super(ReinstallVMSSLArbiterOnly, self).is_valid
872+
873+
874+
class UpdateOpenSSlLibIfConfiguredArbiterOnly(UpdateOpenSSlLibIfConfigured, ReinstallVMSSLArbiterOnly):
875+
pass
876+
877+
878+
class MongoDBUpdateCertificatesIfConfiguredArbiterOnly(MongoDBUpdateCertificatesIfConfigured, ReinstallVMSSLArbiterOnly):
879+
pass
880+
881+
882+
class CreateSSLFolderIfConfiguredArbiterOnly(CreateSSLFolderIfConfigured, ReinstallVMSSLArbiterOnly):
883+
pass
884+
885+
886+
class MongoDBCreateSSLConfForInfraIPIfConfiguredArbiterOnly(MongoDBCreateSSLConfForInfraIPIfConfigured, ReinstallVMSSLArbiterOnly):
887+
pass
888+
889+
890+
class RequestSSLForInfraIfConfiguredArbiterOnly(RequestSSLForInfraIfConfigured, ReinstallVMSSLArbiterOnly):
891+
pass
892+
893+
894+
class CreateJsonRequestFileInfraIfConfiguredArbiterOnly(CreateJsonRequestFileInfraIfConfigured, ReinstallVMSSLArbiterOnly):
895+
pass
896+
897+
898+
class CreateCertificateInfraMongoDBIfConfiguredArbiterOnly(CreateCertificateInfraMongoDBIfConfigured,ReinstallVMSSLArbiterOnly ):
899+
pass
900+
901+
902+
class SetSSLFilesAccessMongoDBIfConfiguredArbiterOnly(SetSSLFilesAccessMongoDBIfConfigured, ReinstallVMSSLArbiterOnly):
903+
pass

0 commit comments

Comments
 (0)