FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Top     SiteMap

Sidebar


Top     SiteMap

Manager Server

Target Server

$FHHOME/bin/xxx.sh | xxxx.exp













.

preparation:fhhome:auth.py.html



Top#OS Management

$FHHOME/fabfile/auth.py

Operation

$ fab -l |grep -F auth.
    auth.ciscopro                           USER=fasthandle PASSWORD=fas***s
    auth.dev                                Develop # USER=fasthandle
    auth.junospro                           USER=fasthandle PASSWORD=fas***s
    auth.netapppro                          USER=root PASSWORD=fas***s
    auth.pro                                Production # USER=fasthandle KEY
    auth.stg                                Staging # USER=fasthandle KEY
    auth.test1                              USER=fasthandle PASSWORD=fas***s
    auth.test2                              USER=user01 PASSWORD=us***01
    auth.winpro                             USER=fasthandle KEY
    auth.winstg                             USER=fasthandle PASSWORD=fas***s
    .....


$FHHOME/fabfile/auth.py



Change login user and password and publickey for your servers.

import sys, glob, os
from fabric.api import *
from fabric.contrib import files

adding os.environ["FHHOME"]

#------------------------------------------------------------------------
# Linux
#------------------------------------------------------------------------
@task
def pro():
    '''Production # USER=fasthandle KEY'''
    env.user = 'fasthandle'
    env.key_filename = '$FHHOME/key/id_rsa.fasthandle.pro-fasthandle-1'
    #env.password = 'passphrase-for-key'

@task
def stg():
    '''Staging # USER=fasthandle KEY'''
    env.user = 'fasthandle'
    env.key_filename = '$FHHOME/key/id_rsa.fasthandle.stg-fasthandle-1'
    #env.password = 'passphrase-for-key'

@task
def dev():
    '''Develop # USER=fasthandle'''
    env.user = 'fasthandle'
    env.key_filename = '$FHHOME/key/id_rsa.fasthandle.dev-fasthandle-1'
    #env.password = 'passphrase-for-key'

@task
def test1():
    '''USER=fasthandle PASSWORD=fas***s'''
    env.user = 'fasthandle'
    env.password = 'fastpass'

@task
def test2():
    '''USER=user01 PASSWORD=us***01'''
    env.user = 'user01'
    env.password = 'user01'

#------------------------------------------------------------------------
# Windows
#------------------------------------------------------------------------
@task
def winpro():
    '''USER=fasthandle KEY'''
    env.user = 'fasthandle'
    env.key_filename = '$FHHOME/key/id_rsa.fasthandle.pro-fasthandle-1'

@task
def winstg():
    '''USER=fasthandle PASSWORD=fas***s'''
    env.user = 'fasthandle'
    env.password = 'fastpass'

#------------------------------------------------------------------------
# Hardware
#------------------------------------------------------------------------
@task
def ciscopro():
    '''USER=fasthandle PASSWORD=fas***s'''
    env.user = 'fasthandle'
    env.password = 'fastpass'

@task
def junospro():
    '''USER=fasthandle PASSWORD=fas***s'''
    env.user = 'fasthandle'
    env.password = 'fastpass'

@task
def netapppro():
    '''USER=root PASSWORD=fas***s'''
    env.user = 'root'
    env.password = 'fastpass'




Top#OS Management



preparation/fhhome/auth.py.html.txt ยท Last modified: 2018/05/08 00:08 by kurihara