Example #1
0
def restart_nginx(*args):
    """
    Restart NGINX server

    """

    global target
    if target:
        with fab_settings(**_build_env(target)):
            _restart_nginx()
    else:
        print "Need to set target first."
Example #2
0
def restart_geoserver(*args):
    """
    Restart Tomcat 7 server, which contains GeoServer.

    """

    global target
    if target:
        with fab_settings(**_build_env(target)):
            _restart_geoserver()
    else:
        print "Need to set target first."
Example #3
0
def restart_apache(*args):
    """
    Restart Apache2 Server

    """

    global target
    if target:
        with fab_settings(**_build_env(target)):
            _restart_apache()
    else:
        print "Need to set target first."
Example #4
0
def inspect(*args):
    """
    Inspects server.

    Prints operating system major release and disk information.
    """

    global target
    if target:
        with fab_settings(**_build_env(target)):
            _inspect()
    else:
        print "Need to set target first."
Example #5
0
def upload_files(
    local=None,
    manifest=None,
    drop=None,
    tries=None,
    user=None,
    group=None,
    notify_level=None,
    iam=None,
    topic=None,
    use_sudo=None,
):
    """
    Uploads files to drop folder on remote server.

    local: path to local files.  Supports wildcards.
    manifest: path to local manifest file that includes a local file path for each line.  Supports wildcards.
    drop: path on remote server to upload files to.
    tries: # of tries to attempt for each file.
    user: user owner of new remote file
    group: group owner of new remote file
    notify_level: notification_level.  0 = No notification.  1 = one aggregate report at end of job.  2 = one aggregate report plus reports for each file.
    iam: AWS IAM user to use for notifications.  Matches values in aws.py
    topic: AWS SNS topic to notify when complete.  Matches values in aws.py
    use_sudo: Use sudo
    """

    global target
    if target:
        with fab_settings(**_build_env(target)):
            _upload_files(
                target,
                local=local,
                manifest=manifest,
                drop=drop,
                tries=tries,
                user=user,
                group=group,
                iam=iam,
                notify_level=notify_level,
                topic=topic,
                use_sudo=use_sudo,
            )
    else:
        print "Need to set target first."
Example #6
0
def add_cache(n=None, d=None, ip=None, l=None, u=None, p=None):
    """
    Adds new cache config to /etc/tilecache.cfg

    Adds new cache config to /etc/tilecache.cfg.  Publishes
    new tileservice.

    Options:
    n = name of cache
    d = human-readable description of new tile cache
    ip = ip of source back-end tile server
    l = layers parameter.  WMS parameter.
    u = user for auth for backend server
    p = password for auth for backend server
    """

    global target
    if target:
        with fab_settings(**_build_env(target)):
            _add_cache(n=n, d=d, ip=ip, l=l, u=u, p=p)
    else:
        print "Need to set target first."