12
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

knife(chef)のsshでホスト名以外のattributeを使う

Last updated at Posted at 2012-12-26

この記事は最終更新から1年以上経過しています。 気をつけてね。

適当なサーバにknife bootstrapしたあと、knife sshなどでなにかコマンド実行させよう。

knife sshはデフォルトではホスト名で接続に行くので、IPが引けないとこうなる。

knife ssh "hostname:hogehoge" "uptime"
FATAL: 1 node found, but do not have the required attribute to stablish the connection. Try setting another attribute to open the connection using --attribute.

この場合、ohaiで取れる別のattributeを使うことが出来る。

knife ssh "hostname:hogehoge" "uptime" --attribute ipaddress
210.xxx.xxx.xxx  02:03:11 up 33 min,  2 users,  load average: 0.00, 0.00, 0.00

OK.

12
13
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
12
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?