FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


middleware:squid: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:squid:index.html [2018/01/10 01:37]
kurihara [squid.py]
middleware:squid:index.html [2019/02/11 00:46] (current)
kurihara
Line 13: Line 13:
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ fab  -H x.x.x.x auth.pro  squid.yum_install+$ fab  -H x.x.x.x   squid.yum_install
 </sxh> </sxh>
  
 +\\
 +==== 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 62: Line 64:
 # Configuration # Configuration
 #---------------------------------------------------------------------- #----------------------------------------------------------------------
-# squid.conf+# squid.change_squidconf:test-server-01
 @task @task
-def change_today_conf():+def change_squidconf(host):
     today = datetime.now().strftime('%Y%m%d')     today = datetime.now().strftime('%Y%m%d')
     sudo("cp -f /etc/squid/squid.conf /etc/squid/squid.conf.`date -d '1day ago' +%Y%m%d`")     sudo("cp -f /etc/squid/squid.conf /etc/squid/squid.conf.`date -d '1day ago' +%Y%m%d`")
-    put("%s/conf/squid/squid.conf.test-server-01.%s" % (FHHOME, today), "/tmp/squid.conf.%s"date) +    put("%s/conf/squid/squid.conf.%s" % (FHHOME, host), "/tmp/squid.conf.%s" % date) 
-    run("diff /tmp/sysctl.conf.%s /etc/sysctl.conf" %s date) +    sudo("mv /tmp/squid.conf.%s /etc/sysctl.conf" % date)
-    sudo("mv /tmp/sysctl.conf.%s /etc/sysctl.conf" %date)+
  
 </sxh> </sxh>
Line 75: Line 76:
  
 \\ \\
-===== Configuration =====+===== Squid Configuration Examples===== 
 +  *[[middleware:squid:squid.conf_default.html]]
   *[[middleware:squid:squid.conf.html]]   *[[middleware:squid:squid.conf.html]]
  


middleware/squid/index.html.1515515868.txt.gz · Last modified: 2018/01/10 01:37 by kurihara