Add per host settings, Add host group support via server_config.json or server_config.yaml files (requires pyyaml)

http://fueledbylemons.com/blog/2011/04/09/server-configs-and-fabric/
This commit is contained in:
Roberto Rosario
2012-06-03 03:03:28 -04:00
parent a4bc5dbd63
commit f47d202b4e
7 changed files with 196 additions and 19 deletions

View File

@@ -1,7 +1,9 @@
from fabric.api import run, sudo, cd, env, task
from fabric.colors import green
from ..conf import setup_environment
from ..literals import WEB_APACHE
import apache
@@ -10,7 +12,7 @@ def install_site():
"""
Install Mayan EDMS site in the webserver configuration files
"""
setup_environment()
print(green('Adding Mayan EDMS\'s site files to: %s' % env.webserver_name, bold=True))
if env.webserver == WEB_APACHE:
@@ -22,6 +24,7 @@ def remove_site():
"""
Install Mayan EDMS's site file from the webserver's configuration
"""
setup_environment()
print(green('Removing Mayan EDMS\'s site file from %s configuration' % env.webserver_name, bold=True))
if env.webserver == WEB_APACHE:
@@ -33,6 +36,7 @@ def restart():
"""
Restart the webserver
"""
setup_environment()
print(green('Restarting the web server: %s' % env.webserver_name, bold=True))
if env.webserver == WEB_APACHE:
@@ -44,6 +48,7 @@ def reload():
"""
Reload webserver configuration files
"""
setup_environment()
print(green('Reloading the web server configuration files', bold=True))
if env.webserver == WEB_APACHE: