【文件属性】:
文件名称:cast:在服务器组上执行远程命令
文件大小:8KB
文件格式:ZIP
更新时间:2021-04-30 15:14:46
Ruby
投
这是一个Ruby gem,它通过ssh在YAML文件中定义的服务器组上执行远程命令。
设置
抓住宝石:
gem install cast-ssh
在〜/ .cast.yml中创建组文件,如下所示:
group1 :
- host1
- host2
- host3
group2 :
- host1
- host4
- host5
使用以下模式在您的shell中运行命令:
cast [ < flags> ] < target> < command>
例如:
cast group1 echo test
cast group1,group2 sudo whoami
cast -s group1,host4 " df -h "
第二个命令的输出如下所示:
[cast] loading groups from ~/.cast.yml
[cast] running ssh h
【文件预览】:
cast-master
----lib()
--------cast.rb(3KB)
----Gemfile(39B)
----spec()
--------test.yml(66B)
--------lib()
--------spec_helper.rb(266B)
----cast.gemspec(1KB)
----.travis.yml(128B)
----LICENSE.md(1KB)
----README.md(3KB)
----.rspec(10B)
----.gitignore(25B)
----bin()
--------cast(2KB)