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:bind:index.html



Top#Middleware Management

BIND (bind.py)

BIND(named) Operation with Fabric

$ fab -l |grep -F bind.

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

Fabric Temporary Run Call Examples

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

$ fab -H $H auth.pro -- "ps aux |grep named"
$ fab -H $H auth.pro -- "lsof -i |grep named"

$ fab -H $H auth.pro -- sudo systemctl status named
$ fab -H $H auth.pro -- sudo systemctl restart named

$ fab -H $H auth.pro -- sudo named-checkconf /etc/named.conf

$ fab -H $H auth.pro -- sudo rndc reload  #Update All Zone Contents
$ fab -H $H auth.pro -- sudo rndc reconfig  #add new zone file


bind.py

$FHHOME/fabfile/bind.py

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

FHHOME=os.environ["FHHOME"]

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


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


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


BIND(named) Configuration Examples



middleware/bind/index.html.txt ยท Last modified: 2018/03/10 01:05 by kurihara