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













.

middleware:vsftpd:index.html



Top#Middleware Management

vsftpd (vsftpd.py)

vsftpd Operation

$ fab -l |grep -F vsftpd.

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


Fabric Temporary Run Call Examples

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

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

$ fab -H $H  -- "ps aux |grep vsftpd"
$ fab -H $H  -- "lsof -i |grep ftp"
$ fab -H $H  -- sudo systemctl status vsftpd
$ fab -H $H  -- 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: 2019/02/11 00:47 by kurihara