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

Commit10e22cf

Browse files
committed
Specify locksmith hosts
These commands can run on any machine in our stack, but it makessense to pick an etcd machine at random to run them on.
1 parent9c34ce3 commit10e22cf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎locksmith.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
fromfabric.apiimportrun,task
2+
importutil
23

34
etcd_cluster='http://etcd-1.management:4001,http://etcd-2.management:4001,http://etcd-3.management:4001'
45

56
@task
67
defstatus():
78
"""Get the status of locksmith"""
9+
util.use_random_host('class-etcd')
810
run("/usr/bin/locksmithctl -endpoint='{0}' status".format(etcd_cluster))
911

1012
@task
1113
defunlock(machine_name):
1214
"""Unlock a machine with locksmith"""
15+
util.use_random_host('class-etcd')
1316
run("/usr/bin/locksmithctl -endpoint='{0}' unlock '{1}'".format(etcd_cluster,machine_name))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp