Table of Contents

Top#Middleware Management

vsftpd (vsftpd.py)

$FHHOME/fabfile/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



Top#Middleware Management