File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
from fabric .api import *
2
- from nginx import kill as nginx_kill
3
- from puppet import disable as puppet_disable
2
+ import nginx
3
+ import puppet
4
4
5
5
@task
6
6
@roles ('class-cache' )
7
7
def fail_to_mirror ():
8
8
"""Fails the site to the mirror"""
9
- puppet_disable ()
10
- nginx_kill ()
11
- print ("Disabled Puppet and stopped Nginx, remember to re-enable these" )
9
+ puppet .disable ()
10
+ nginx .disable_vhost ("www.gov.uk" )
11
+ nginx .hello_it ()
12
+ print ("Disabled Puppet and disabled www.gov.uk vhost, remember to re-enable these" )
Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ def gracefulstop(wait=True):
9
9
# Poll for Nginx, until it's no longer running.
10
10
run ('while pgrep nginx >/dev/null; do echo "Waiting for Nginx to exit.."; sleep 1; done' )
11
11
12
+ @task
13
+ def disable_vhost (vhost_filename ):
14
+ """Disable a vhost by removing its symlink from /etc/nginx/sites-enabled"""
15
+ sudo ('rm -f /etc/nginx/sites-enabled/%s' % vhost_filename )
16
+
12
17
@task
13
18
def kill ():
14
19
"""Shut down Nginx immediately without waiting for it to finish running"""
You can’t perform that action at this time.
0 commit comments