Skip to content

Commit 10e22cf

Browse files
committed
Specify locksmith hosts
These commands can run on any machine in our stack, but it makes sense to pick an etcd machine at random to run them on.
1 parent 9c34ce3 commit 10e22cf

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
from fabric.api import run, task
2+
import util
23

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

56
@task
67
def status():
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
def unlock(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)