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: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   bind.xxxxx

Fabric Temporary Run Call Examples

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

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

$ fab -H $H  -- sudo systemctl status named
$ fab -H $H  -- sudo systemctl restart named

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

$ fab -H $H  -- sudo rndc reload  #Update All Zone Contents
$ fab -H $H  -- 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: 2019/02/11 00:45 by kurihara