Skip to content

Commit 8bc8527

Browse files
committed
Merge pull request alphagov#195 from alphagov/disaster-recovery-hosts
Task for disaster recovery hosts
2 parents b311a14 + 1cab233 commit 8bc8527

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from fabric.api import *
1+
from fabric.api import sudo, task
22

33

44
@task

fabfile.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def fetch(self):
9595
return
9696

9797
self.hosts = _fetch_hosts()
98+
self.roledefs['disaster_recovery'] = _fetch_hosts('--dr-only')
9899

99100
for host in self.hosts:
100101
try:
@@ -311,6 +312,12 @@ def vdc(vdc_name):
311312
env.hosts.extend(env.roledefs['vdc-%s' % vdc_name]())
312313

313314

315+
@task
316+
def disaster_recovery():
317+
"""Select disaster recovery machines"""
318+
env.hosts.extend(env.roledefs['disaster_recovery']())
319+
320+
314321
@task
315322
@runs_once
316323
def hosts():

vm.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,7 @@ def bodge_unicorn(name):
6060
"""
6161
Manually kill off (and restart) unicorn processes by name
6262
63-
e.g. To kill off and restart contentapi on backend-1 in Preview:
64-
65-
fab integration -H backend-1.backend vm.bodge_unicorn:contentapi
66-
67-
...or on all backend hosts in Preview:
68-
69-
fab integration class:backend vm.bodge_unicorn:contentapi
63+
e.g. vm.bodge_unicorn:contentapi
7064
7165
Yes. This is a bodge. Sorry.
7266
"""

0 commit comments

Comments
 (0)