FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Sidebar


Top     SiteMap

Manager Server

Target Server

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













.

os:linux:pkg:index.html



This is an old revision of the document!


Top#OS Management

Package Management (pkg.py)

Operation

$ fab -l |grep pkg

$ fab  -H $H auth.pro  pkg.check_cmd
$ fab  -H $H auth.pro  pkg.install_rpm_centos7

Ref. Remote Shell Commands

$ H=test-server-01,test-server-02
$ fab -H $H auth.pro  -- "rpm -q xxxx"
$ fab -H $H auth.pro  -- "rpm -qa |grep xxx"
$ fab -H $H auth.pro --  "rpm -qa --last | head -20"


pkg.py

$FHHOME/fabfile/pkg.py

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

FHHOME=os.environ["FHHOME"]

#===============================================================================
#Check Commands
#===============================================================================
@task
def check_cmd():
    put("%s/scripts/check_cmd.sh" % FHHOME, "scripts/check_cmd.sh", mode=0755)
    sudo("scripts/check_cmd.sh")


#===============================================================================
# Installing Package
#===============================================================================
#----------------------------------------------------------------------
# CentOS7
#----------------------------------------------------------------------
#pkg.install_rpm_centos7
@task
def install_rpm_centos7():
    put("%s/scripts/rpm.sh" % FHHOME, "scripts/rpm.sh", mode=0755)
    sudo("scripts/rpm.sh centos7", pty=False)

#----------------------------------------------------------------------
#CentOS6
#----------------------------------------------------------------------
#pkg.install_rpm_centos6


#----------------------------------------------------------------------
#Ubuntu16
#----------------------------------------------------------------------
#pkg.install_dpkg_ubuntu16






$FHHOME/scripts



os/linux/pkg/index.html.1517754210.txt.gz ยท Last modified: 2018/02/04 23:23 by kurihara