FastHandle - Automation Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Top     SiteMap

Sidebar


Top     SiteMap

Manager Server

Target Server













.

languages:php:index.html



Top#Programming Languages

PHP (php.py)

$FHHOME/fabfile/php.py


PHP Operation

$ fab -l |grep php

$ fab  -H $H auth.pro  php.install_yum

$ H=test-server-1,test-server-2

$ fab  -H $H auth.pro  -- "php -v"


php.py

$FHHOME/fabfile/php.py

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

#----------------------------------------------------------------------
# Check PHP
#----------------------------------------------------------------------
# php.check_php_rpm
@task
def check_php_rpm():
    '''rpm -qa |grep php'''
    sudo("rpm -qa |grep  php")



#----------------------------------------------------------------------
# Installing PHP
#----------------------------------------------------------------------
# php.install_yum
@task
def install_yum():
    sudo("rpm -q php            > /dev/null 2>&1 || yum -y install php")
    sudo("rpm -q php-mbstrig    > /dev/null 2>&1 || yum -y install php-mbstrig") 

# php.install_phpfpm_yum
@task
def install_phpfpm_yum():
    sudo("yum -y install php-cli php-mbstring php-fpm")



PHP Configuration



languages/php/index.html.txt ยท Last modified: 2018/01/05 00:09 by kurihara