FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


middleware:tftp:index.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
middleware:tftp:index.html [2018/02/01 01:14]
kurihara
middleware:tftp:index.html [2019/02/11 00:47] (current)
kurihara
Line 7: Line 7:
 \\ \\
  
-===== Squid Operation =====+===== TFTP Operation =====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
 $ fab -l |grep tftp $ fab -l |grep tftp
Line 13: Line 13:
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ fab  -H x.x.x.x auth.pro  tftp.xxxxx+$ fab  -H x.x.x.x   tftp.xxxxx
 </sxh> </sxh>
  
- +\\ 
-==== Ref. Remote Shell Commands ====+==== Fabric Temporary Run Call Examples ====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
 $ H=test-serve-01,test-server-02 $ H=test-serve-01,test-server-02
  
-$ fab -H $H auth.pro -- sudo diff /etc/squid/squid.conf /etc/squid/squid.conf.20171205 +$ fab -H $H  -- sudo diff /etc/squid/squid.conf /etc/squid/squid.conf.20171205 
-$ fab -H $H auth.pro -- sudo mv /etc/squid/squid.conf.20171205 /etc/squid/squid.conf+$ fab -H $H  -- sudo mv /etc/squid/squid.conf.20171205 /etc/squid/squid.conf
  
-$ fab -H $H auth.pro -- "ps aux |grep suqid" +$ fab -H $H  -- "ps aux |grep suqid" 
-$ fab -H $H auth.pro -- sudo systemctl status squid +$ fab -H $H  -- sudo systemctl status squid 
-$ fab -H $H auth.pro -- sudo systemctl restart squid+$ fab -H $H  -- sudo systemctl restart squid
 </sxh> </sxh>
  
Line 37: Line 37:
 import sys, os import sys, os
 from fabric.api import * from fabric.api import *
-from fabric.contrib import files, sed+from fabric.contrib import files
  
 FHHOME=os.environ["FHHOME"] FHHOME=os.environ["FHHOME"]
Line 46: Line 46:
 # squid.install_tftp # squid.install_tftp
 @task @task
-def install_tftp():+def install_rpm():
     '''yum install tftp tftp-server xinetd '''     '''yum install tftp tftp-server xinetd '''
     sudo("rpm -q tftp         > /dev/null 2>&1 || yum -y install tftp")     sudo("rpm -q tftp         > /dev/null 2>&1 || yum -y install tftp")
Line 59: Line 59:
 def conf(): def conf():
     sudo("cp -p /etc/xinetd.d/tftp ~/tftp.`date -d '1day ago' +%Y%m%d`")     sudo("cp -p /etc/xinetd.d/tftp ~/tftp.`date -d '1day ago' +%Y%m%d`")
-    +
     #disable                 = no     #disable                 = no
     sudo("sed -i '/disable/ s/yes/no/' /etc/xinetd.d/tftp")     sudo("sed -i '/disable/ s/yes/no/' /etc/xinetd.d/tftp")
     #sed -i "s/\(disable[\t]*= *\).*/\1no/" /etc/xinetd.d/tftp     #sed -i "s/\(disable[\t]*= *\).*/\1no/" /etc/xinetd.d/tftp
-    +
     #server_args             = -c -u root -s /var/lib/tftpboot     #server_args             = -c -u root -s /var/lib/tftpboot
-    sudo(sed -i "s/\(server_args[\t]*= *\).*/\1-c -u root -s \/var\/lib\/tftpboot/" /etc/xinetd.d/tftp)+    sudo('sed -i "s/\(server_args[\t]*= *\).*/\1-c -u root -s \/home\/fasthandle\/fhhome\/tftp/" /etc/xinetd.d/tftp')
     #sed -i "s/\(server_args[\t]*= *\).*/\1-s \/opt\/Tftproot -c/" /etc/xinetd.d/tft     #sed -i "s/\(server_args[\t]*= *\).*/\1-s \/opt\/Tftproot -c/" /etc/xinetd.d/tft
  
-   sudo("mkdir /home/fasthandle/tftp"+    sudo("test -d /home/fasthandle/fhhome/tftp || mkdir /home/fasthandle/fhhome/tftp"
-   sudo("chmod 777 /home/fasthandle/tftp")+    sudo("chmod 777 /home/fasthandle/fhhome/tftp")
  
 #---------------------------------------------------------------------- #----------------------------------------------------------------------
 # Service # Service
 #---------------------------------------------------------------------- #----------------------------------------------------------------------
- 
- 
  
 </sxh> </sxh>
  
  
-\\ 
-===== Configuration ===== 
-  *[[middleware:squid:squid.conf_default.html]] 
-  *[[middleware:squid:squid.conf.html]] 
  
  


middleware/tftp/index.html.1517415271.txt.gz · Last modified: 2018/02/01 01:14 by kurihara