FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


appendix:fabric-vs-others.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
appendix:fabric-vs-others.html [2018/02/24 02:37]
kurihara
appendix:fabric-vs-others.html [2020/02/20 23:39]
kurihara
Line 1: Line 1:
 [[:index.html#Appendix|Top#Appendix]] [[:index.html#Appendix|Top#Appendix]]
  
-======Python Fabric vs Other Tools======+======Python Fabric vs ssh vs Ansible======
  
 \\ \\
Line 14: Line 14:
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ fab -H x.x.x.x auth.pro -- hostname +$ fab -H x.x.x.x  -- hostname
-$ fab -H x.x.x.x auth.stg -- hostname+
  
 vs vs
Line 27: Line 26:
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ fab -H x.x.x.x auth.pro -- "echo "any host 192.168.100.1 gw 192.168.0.5" >> /etc/sysconfig/static-routes+$ fab -H x.x.x.x  -- sudo "bash -c 'echo "any host 192.168.100.1 gw 192.168.0.5" >> /etc/sysconfig/static-routes'"
-$ fab -H x.x.x.x auth.pro -- "echo 'any host 192.168.100.1 gw 192.168.0.5' >> /etc/sysconfig/static-routes"+
  
 vs vs
Line 36: Line 34:
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ fab  -H x.x.x.x auth.pro -- "sed s/192.168.100.10/192.168.50.10/g /etc/hosts > /etc/hosts.`date '+%Y%m%d'`"+$ fab  -H x.x.x.x  -- sudo "bash -c 'sed s/192.168.100.10/192.168.50.10/g /etc/hosts > /etc/hosts.`date '+%Y%m%d'`'"
  
 vs vs
Line 45: Line 43:
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
 $ H="192.168.0.1,192.168.0.2" $ H="192.168.0.1,192.168.0.2"
-$ fab -H $H  auth.pro -- hostname+$ fab -H $H   -- hostname
  
 vs vs
Line 97: Line 95:
 ==== Example ==== ==== Example ====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ ansible -i 127.0.0.1, all  -u user01 --a "hostname"+$ ansible -i 192.168.0.10, all   -a "hostname" 
 +$ ansible -i 192.168.0.10,192.168.0.11, all   -a "hostname" 
 + 
 +$ ansible -i 192.168.0.10,192.168.0.11, all   -a "sudo hostname" 
 +$ ansible -i 192.168.0.10,192.168.0.11, all -s  -a "hostname"
 </sxh> </sxh>
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ ansible -i 127.0.0.1, all  -u root -k -a "whoami"+$ ansible -i 192.168.0.10, all   -u root -k -a "hostname"
 SSH password: SSH password:
-127.0.0.| SUCCESS | rc=0 >>+192.168.0.10 | SUCCESS | rc=0 >>
 root root
 </sxh> </sxh>


appendix/fabric-vs-others.html.txt · Last modified: 2020/02/20 23:46 by kurihara