FastHandle is fast operation tools for infrastructure configurations and tests.
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
preparation:installing.html [2018/03/14 00:26] kurihara |
preparation:installing.html [2020/01/23 01:11] (current) kurihara |
||
---|---|---|---|
Line 10: | Line 10: | ||
== Create fasthandle user== | == Create fasthandle user== | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
- | # useradd fasthandle | + | ~]# useradd fasthandle |
- | # echo ' | + | ~]# echo ' |
</ | </ | ||
== fasthandle user Configuration== | == fasthandle user Configuration== | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
- | # su - fasthandle | + | ~]# su - fasthandle |
</ | </ | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
- | $ cp -p ~/.bashrc ~/ | + | ~]$ cp -p ~/.bashrc ~/ |
- | $ cat << @ >> ~/.bashrc | + | ~]$ cat << @ >> ~/.bashrc |
# HastHandle env | # HastHandle env | ||
Line 30: | Line 30: | ||
HISTSIZE=10000 | HISTSIZE=10000 | ||
HISTFILESIZE=10000 | HISTFILESIZE=10000 | ||
- | HISTTIMEFORMAT=' | + | HISTTIMEFORMAT=' |
+ | PROMPT_COMMAND=" | ||
+ | |||
+ | PS1=" | ||
@ | @ | ||
</ | </ | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
- | $ cp -p ~/ | + | ~]$ cp -p ~/ |
- | $ cat << @ >> ~/ | + | ~]$ cat << @ >> ~/ |
# Don't listen yes/no. | # Don't listen yes/no. | ||
Line 45: | Line 48: | ||
@ | @ | ||
- | $ chmod 600 ~/ | + | ~]$ chmod 600 ~/ |
</ | </ | ||
Line 58: | Line 61: | ||
\\ | \\ | ||
==== Fabric ==== | ==== Fabric ==== | ||
- | === Check Python Before Installing Fabric=== | ||
- | Fabric | + | ===Fabric |
+ | You must use Fabric or fabric3. these days, you should use fabric3. | ||
+ | fabric2 is the different of use. | ||
+ | |||
+ | |<100% 100px ->| | ||
+ | | Fabric | ||
+ | | fabric2 | ||
+ | | fabric3 | ||
+ | |||
+ | |||
+ | \\ | ||
+ | === Check Python Before Installing Fabric=== | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | # python -V | + | ~]# python -V |
Python 2.7.5 | Python 2.7.5 | ||
</ | </ | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | # python3 -V | + | ~]# python3 -V |
Python 3.5.2 | Python 3.5.2 | ||
</ | </ | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | RHEL/CentOS $ rpm -qa |grep python | + | RHEL/ |
- | Ubuntu $ dpkg -l |grep python | + | Ubuntu |
</ | </ | ||
Line 82: | Line 95: | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | # export http_proxy=http:// | + | ~]# export http_proxy=http:// |
- | # export https_proxy=http:// | + | ~]# export https_proxy=http:// |
- | # yum install epel-release | + | ~]# yum install epel-release |
- | # yum install fabric | + | ~]# yum info fabric |
+ | ~]# yum install fabric | ||
+ | ~]# fab --version | ||
+ | Fabric 1.14.0 | ||
+ | Paramiko 1.16.1 | ||
</ | </ | ||
\\ | \\ | ||
=== RHEL/CentOS with pip=== | === RHEL/CentOS with pip=== | ||
+ | ==Fabric== | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | # yum install gcc python-devel python-setuptools | + | ~]# yum install gcc python-devel python-setuptools |
- | # easy_install pip | + | ~]# easy_install pip |
- | # pip install fabric | + | ~]# pip search fabric |
+ | ~]# pip install fabric== | ||
+ | ~]# pip install fabric==1.14.0 | ||
+ | ~]# fab --version | ||
+ | Fabric 1.14.0 | ||
+ | Paramiko 1.16.1 | ||
+ | </ | ||
+ | |||
+ | ==Fabric3== | ||
+ | <sxh text toolbar: | ||
+ | ~]# yum install gcc python-devel python-setuptools | ||
+ | ~]# easy_install pip | ||
+ | ~]# pip search fabric3 | ||
+ | ~]# pip install fabric3 | ||
+ | ~]# fab --version | ||
+ | Fabric 1.14.0 | ||
+ | Paramiko 1.16.1 | ||
+ | </ | ||
+ | |||
+ | |||
+ | \\ | ||
+ | === RHEL/CentOS with virtualenv, pip=== | ||
+ | <sxh text toolbar: | ||
+ | ~]# yum install gcc python-devel python-setuptools | ||
+ | |||
+ | ~]# sudo su - fasthandle | ||
+ | ~]# pip install virtualenv | ||
+ | ~]# cd /home | ||
+ | ~]# virtualenv env_fasthandle -p python2.7 | ||
+ | ~]# source env_fasthandle/ | ||
+ | ~]# pip install fabric==1.14.0 | ||
+ | |||
+ | ~]# deactivate | ||
+ | |||
+ | ~]$ cat << END >> ~/.bashrc | ||
+ | |||
+ | # | ||
+ | source env_fasthandle/ | ||
+ | |||
+ | END | ||
</ | </ | ||
Line 100: | Line 157: | ||
=== Debian/ | === Debian/ | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | # apt install fabric | + | ~]# apt install fabric |
</ | </ | ||
Line 106: | Line 163: | ||
\\ | \\ | ||
=== Debian/ | === Debian/ | ||
+ | ==Fabric== | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | # apt-get install python-dev python-setuptools gcc | + | ~]# apt-get install python-dev python-setuptools gcc |
- | # easy_install pip | + | ~]# easy_install pip |
- | # pip install fabric | + | ~]# pip install fabric== |
+ | ~]# pip install fabric==1.x.x | ||
</ | </ | ||
+ | |||
+ | ==fabric3== | ||
+ | <sxh text toolbar: | ||
+ | ~]# apt-get install python-dev python-setuptools gcc | ||
+ | ~]# easy_install pip | ||
+ | ~]# pip install fabric3 | ||
+ | </ | ||
+ | |||
\\ | \\ | ||
=== Debian/ | === Debian/ | ||
<sxh bash toolbar: | <sxh bash toolbar: | ||
- | $ virtualenv -p python3 env | + | ~]$ virtualenv -p python3 env |
- | $ source env/ | + | ~]$ source env/ |
- | $ pip3 install fabric3 | + | ~]$ pip3 install fabric3 |
</ | </ | ||
Line 124: | Line 191: | ||
=== RHEL/CentOS === | === RHEL/CentOS === | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | # export http_proxy=http:// | + | ~]# export http_proxy=http:// |
- | # export https_proxy=http:// | + | ~]# export https_proxy=http:// |
- | # yum search expect | + | ~]# yum search expect |
- | # yum install expect | + | ~]# yum install expect |
</ | </ | ||
Line 134: | Line 201: | ||
=== Debian/ | === Debian/ | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | # apt search expect | + | ~]# apt search expect |
- | # apt install expect | + | ~]# apt install expect |
</ | </ | ||
Line 142: | Line 209: | ||
\\ | \\ | ||
===== Installing FastHandle ===== | ===== Installing FastHandle ===== | ||
+ | |||
+ | You can install FastHandle "From GitHub(Method 1 or 2)" or "Make it yourself(Method 3)". | ||
+ | |||
==== Method 1 : From GitHub ==== | ==== Method 1 : From GitHub ==== | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | $ cd / | + | ~]$ cd / |
- | $ git clone https:// | + | ~]$ test -d fhhome && mv fhhome fhhome.`date +%Y%m%d` |
- | $ tree -a -I ' | + | |
- | $ chmod 755 fhhome/fhscripts/* | + | ~]$ git clone https:// |
+ | |||
+ | ~]$ tree -a -I ' | ||
+ | ~]$ chmod 755 fhhome/bin/* | ||
</ | </ | ||
Line 155: | Line 228: | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | $ cd / | + | ~]$ cd / |
- | $ git clone https:// | + | ~]$ git clone https:// |
- | $ tree -a -I ' | + | ~]$ tree -a -I ' |
- | $ mkdir fhhome | + | ~]$ mkdir fhhome |
- | $ cp -pr fhhome.`date +%Y%m%d`/ fhhome/ | + | ~]$ cp -pr fhhome.`date +%Y%m%d`/ fhhome/ |
- | $ chmod 755 fhhome/fhscripts/* | + | ~]$ chmod 755 fhhome/bin/* |
</ | </ | ||
- | /* | + | |
\\ | \\ | ||
- | ==== Method | + | ==== Method |
- | You can install "From GitHub(Method 1)" or "Make it yourself(Method 2)". | ||
Reference **[[preparation: | Reference **[[preparation: | ||
Line 173: | Line 245: | ||
==1. Make some directory == | ==1. Make some directory == | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | # su - fasthandle | + | ~]# su - fasthandle |
- | $ cd / | + | ~]$ cd / |
- | $ mkdir fhhome | + | ~]$ mkdir fhhome |
- | $ cd fhhome | + | ~]$ cd fhhome |
- | $ mkdir -p fhscripts | + | ~]$ mkdir -p bin fabfile hosts key log target/bin target/deb target/key target/ |
</ | </ | ||
Line 189: | Line 261: | ||
== 3. Copy FastHandle Scripts == | == 3. Copy FastHandle Scripts == | ||
- | Please copy the necessary files and change permission like '' | + | Please copy the necessary files and change permission like '' |
*[[: | *[[: | ||
- | */ | + | |
+ | == 4. Change mode the bash scripts == | ||
+ | <sxh bash toolbar: | ||
+ | ~]# chmod 755 $FHHOME/ | ||
+ | </sxh> | ||
\\ | \\ | ||
Line 199: | Line 276: | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | $ fab -l | + | ~]$ fab -l |
Available commands: | Available commands: | ||
Line 218: | Line 295: | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | $ fab -H localhost test.local_hostname | + | ~]$ fab -H localhost test.local_hostname |
</ | </ | ||
Line 226: | Line 303: | ||
=== Configuring FastHandle ==== | === Configuring FastHandle ==== | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | $ cd $FHHOME | + | ~]$ cd $FHHOME |
- | $ vi auth.py | + | ~]$ vi auth.py |
# Configureing User and Password | # Configureing User and Password | ||
Line 234: | Line 311: | ||
<sxh text toolbar: | <sxh text toolbar: | ||
- | $ fab -H 127.0.0.1 auth.test1 -- hostname | + | ~]$ fab -H 127.0.0.1 auth.test1 -- hostname |
- | $ fab -H 127.0.0.1 auth.test1 test.hostname | + | ~]$ fab -H 127.0.0.1 auth.test1 test.hostname |
- | $ fab -H x.x.x.x auth.test1 -- hostname | + | ~]$ fab -H x.x.x.x auth.test1 -- hostname |
- | $ fab -H x.x.x.x auth.test1 test.hostname | + | ~]$ fab -H x.x.x.x auth.test1 test.hostname |
</ | </ | ||
My Sites
SNS
Copyright (c) 2025 FastHandle - IT Operations Examples All Rights Reserved.