Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita37dc35

Browse files
committed
Add a Fabric task to mount encrypted MongoDB drive
This task first checks whether the drive is already mounted. If itdoesn't do this check, it will remove stop MongoDB and remove allthe data from the encrypted drive.Mounting the encrypted drive asks for a passphrase through Fabric,which just works.
1 parente16816f commita37dc35

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎mongo.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,16 @@ def safe_reboot():
211211
abort("Cluster has not recovered")
212212

213213
execute(vm.reboot,hosts=[env['host_string']])
214+
215+
216+
@task
217+
defmount_licensify_encrypted_drive():
218+
withsettings(ok_ret_codes=[0,1]):
219+
result=run('grep /var/lib/mongodb /proc/mounts')
220+
ifresult.return_code==0:
221+
exit('/var/lib/mongodb is already mounted on this host.')
222+
withsettings(warn_only=True):
223+
sudo('service mongodb stop')
224+
sudo('rm -rf /var/lib/mongodb/*')
225+
sudo('mount /var/lib/mongodb')
226+
sudo('service mongodb start')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp