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:test.py.html




Top#Preparation

$FHHOME/fabfile/test.py

Operation

$ echo xx.xx.xx.xx | fab -- hostname
$ echo xx.xx.xx.xx | fab -- sudo cat /etc/shadow

$ fab local_hostname

$ fab -l |grep test.    # check options

$ echo xx.xx.xx.xx | fab auth.test test.hostname
$ fhghost.sh "*" hosts/test | fab auth.test test.hostname


fabfile/test.py

import sys
from fabric.api import *
from fabric.contrib import files

# test.local_hostname
@task
def local_hostname():
    local('hostname')

# test.hostname
@task
def hostname():
    run('hostname')


# test.cat_etc_shadow
@task
def cat_etc_shadow():
    sudo('cat /etc/shadow')




Top#Preparation



preparation/fhhome/test.py.html.txt ยท Last modified: 2017/12/31 23:17 by kurihara