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













.

middleware:vsftpd:index.html



Top#Middleware Management

vsftpd (vsftpd.py)

vsftpd Operation

$ fab -l |grep -F vsftpd.

$ fab  -H x.x.x.x auth.pro  vsftpd.xxxxx


Fabric Temporary Run Call Examples

$ H=test-serve-01,test-server-02

$ fab -H $H auth.pro -- sudo diff /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.20171205
$ fab -H $H auth.pro -- sudo mv /etc/vsftpd/vsftpd.conf.20171205 /etc/vsftpd/vsftpd.conf

$ fab -H $H auth.pro -- "ps aux |grep vsftpd"
$ fab -H $H auth.pro -- "lsof -i |grep ftp"
$ fab -H $H auth.pro -- sudo systemctl status vsftpd
$ fab -H $H auth.pro -- sudo systemctl restart vsftpd


vsftp.py

$FHHOME/fabfile/vsftp.py

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

FHHOME=os.environ["FHHOME"]

#----------------------------------------------------------------------
# Installing vsftpd
#----------------------------------------------------------------------
# vsftpd.install_rpm
@task
def install_rpm():
    '''yum install vsftpd '''
    sudo("rpm -q ftp            > /dev/null 2>&1 || yum -y install ftp")
    sudo("rpm -q vsftpd         > /dev/null 2>&1 || yum -y install vsftpd")


#----------------------------------------------------------------------
# Configuration
#----------------------------------------------------------------------
# tftp.conf
@task
def conf():
    sudo("cp -p /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.`date -d '1day ago' +%Y%m%d`")



#----------------------------------------------------------------------
# Service
#----------------------------------------------------------------------


vsftpd Configuration Examples



middleware/vsftpd/index.html.txt ยท Last modified: 2018/02/21 23:51 by kurihara