FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


os:linux:example: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
os:linux:example:index.html [2018/03/12 01:16]
kurihara
os:linux:example:index.html [2020/02/21 01:18] (current)
kurihara
Line 2: Line 2:
 ====== Linux Fabric Examples===== ====== Linux Fabric Examples=====
  
-$FHHOME/fabfile/tmp.py+$FHHOME/fabfile/example.py
  
 {{INLINETOC}} {{INLINETOC}}
Line 11: Line 11:
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ fab  -l |grep tmp+$ fab  -l |grep example
-echo xx.xx.xx.xx | fab  auth.pro  ope.check_user01+$ fab -H host1,host2   ope.check_user01
 </sxh> </sxh>
  
Line 18: Line 18:
 ==== Fabric one-line Task Examples ==== ==== Fabric one-line Task Examples ====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ echo xx.xx.xx.xx | fab auth.pro -- hostname +fab -H host1,host2  -- hostname 
-$ echo xx.xx.xx.xx | fab auth.pro -- sudo cat /etc/shadow+fab -H host1,host2  -- sudo cat /etc/shadow
 </sxh> </sxh>
  
 \\ \\
-===== tmp.py =====+===== example.py =====
  
-$FHHOME/fabfile/tmp.py+$FHHOME/fabfile/example.py
  
 <sxh python toolbar:false gutter:false> <sxh python toolbar:false gutter:false>
Line 52: Line 52:
  
 </sxh> </sxh>
 +
 +\\
 +===== TIPS =====
 +==== color ====
 +
 +<sxh python toolbar:false gutter:false>
 +from fabric.colors import *
 +
 +def color():
 +    print 'aaaaa'
 +    print blue('blue') + ' color'
 +    print cyan('cyan') + ' color'
 +    print green('green') + ' color'
 +    print magenta('magenta') + ' color'
 +    print red('red') + ' color'
 +    print white('white') + ' color'
 +    print yellow('yellow') + ' color'
 +    print (red("This sentence is red, except for " +  green("these words, which are green") + "."))
 +</sxh>
 +
 +==== tomcat start ====
 +<sxh python toolbar:false gutter:false>
 +def startTomcat():
 +    run('/etc/init.d/tomcat start < /dev/null > /dev/null 2> /dev/null', pty=False, timeout = 60)
 +</sxh>
 +
  
 \\ \\


os/linux/example/index.html.1520784994.txt.gz · Last modified: 2018/03/12 01:16 by kurihara