LoginSignup
5
6

More than 5 years have passed since last update.

Itamae | ssh コマンドでリモートプロビジョニング #devops #itamae

Posted at

Itamae | ssh コマンドでリモートプロビジョニング #devops #itamae

概要

プロビジョニングツール Itamae
ssh コマンドでリモートプロビジョニング。

ssh コマンド仕様

ssh の help は以下。

$ itamae help ssh
Usage:
  itamae ssh RECIPE [RECIPE...] -h, --host=HOST

Options:
  -j, [--node-json=NODE_JSON]      
  -n, [--dry-run], [--no-dry-run]  
  -h, --host=HOST                  
  -u, [--user=USER]                
  -i, [--key=KEY]                  
  -p, [--port=N]                   
      [--ohai], [--no-ohai]        
      [--vagrant], [--no-vagrant]  
  -l, [--log-level=LOG_LEVEL]      
                                   # Default: info
      [--color], [--no-color]      
                                   # Default: true

Run Itamae via ssh

試行

仕様

  • tree をインストールするだけのレシピを利用。
package "tree" do
  action :install
end
  • 対象サーバーは、 192.168.33.99 とする。
  • user は vagrant

実行

# ssh コマンドでローカル環境からプロビジョニング実行
$ itamae ssh -h 192.168.33.99 -u vagrant recipe.rb

# 192.168.33.99 に ssh 接続して tree のインストール結果を確認
$ vagrant ssh
$ tree --version
tree v1.5.3 (c) 1996 - 2009 by Steve Baker, Thomas Moore, Francesc Rocher, Kyosuke Tokoro
$ seq 10 | xargs mkdir
$ tree
.
|-- 1
|-- 10
|-- 2
|-- 3
|-- 4
|-- 5
|-- 6
|-- 7
|-- 8
`-- 9

参照

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6