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
Last revision Both sides next revision
middleware:tftp:index.html [2018/02/01 01:16]
kurihara [tftp.py]
middleware:tftp:index.html [2018/02/21 23:51]
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 16: Line 16:
 </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
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 \/home\/fasthandle\/fhhome\/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("test -d /home/fasthandle/fhhome/tftp || mkdir /home/fasthandle/fhhome/tftp"+    sudo("test -d /home/fasthandle/fhhome/tftp || mkdir /home/fasthandle/fhhome/tftp"
-   sudo("chmod 777 /home/fasthandle/fhhome/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.txt · Last modified: 2019/02/11 00:47 by kurihara