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

Commit812ecaf

Browse files
committed
Merge pull requestalphagov#137 from alphagov/add-mongodb-remount-task
Add a Fabric task to mount encrypted MongoDB drive
2 parentse16816f +a37dc35 commit812ecaf

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