Last active
October 8, 2015 02:26
-
-
Save lorentzca/5bd07ea8fd19f8af70c6 to your computer and use it in GitHub Desktop.
複数のホストにcookするやつ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'thor' | |
class CookMan < Thor | |
desc "prepare", "Prepare to one or more hosts" | |
option :hostname, :required => true, :aliases => :h, :type => :array | |
def prepare | |
options[:hostname].each do |h| | |
system "bundle exec knife solo prepare #{h}" | |
end | |
end | |
desc "cook", "Cook to one or more hosts" | |
option :hostname, :required => true, :aliases => :h, :type => :array | |
def cook | |
options[:hostname].each do |h| | |
system "bundle exec knife solo cook #{h}" | |
end | |
end | |
desc "bootstrap", "Bootstrap to one or more hosts" | |
option :hostname, :required => true, :aliases => :h, :type => :array | |
def bootstrap | |
options[:hostname].each do |h| | |
system "bundle exec knife solo bootstrap #{h}" | |
end | |
end | |
end | |
CookMan.start(ARGV) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
準備
うさげ
とど
$ echo hogehoge.hoge piyopiyo.piyo | xargs -n 1 bundle exec knife solo cook
でよいのでは?