1

Serverspec テスト ツールは初めてです。
テストを実行すると、次のエラーが発生しました。

[root@ost-svr004 serverspec]# rake spec
/usr/bin/ruby -I/usr/lib/ruby/gems/2.1.0/gems/rspec-support-3.1.2/lib:/usr/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib /usr/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/exe/rspec --pattern spec/www.example.jp/\*_spec.rb
/usr/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:70:in `initialize': getaddrinfo: Name or service not known (SocketError)
        from /usr/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:70:in `open'
        from /usr/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:70:in `block in initialize'
        from /usr/lib/ruby/2.1.0/timeout.rb:76:in `timeout'
        from /usr/lib/ruby/2.1.0/timeout.rb:127:in `timeout'
        from /usr/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh/transport/session.rb:67:in `initialize'
        from /usr/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh.rb:202:in `new'
        from /usr/lib/ruby/gems/2.1.0/gems/net-ssh-2.9.1/lib/net/ssh.rb:202:in `start'
        .....
/usr/bin/ruby -I/usr/lib/ruby/gems/2.1.0/gems/rspec-support-3.1.2/lib:/usr/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib /usr/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/exe/rspec --pattern spec/www.example.jp/\*_spec.rb failed

Serverspec のインストール中は、http://serverspec.org/の指示に従いました。前提として、「Developer Tools」、Ruby、RubyGemもインストールしました。

4

1 に答える 1

0

実際、 localhost に対して serverspec テストを実行するExec (local)と、問題なく問題は発生しませんでした。しかし、リモート ホストのテストを実行すると失敗し、この問題が発生します。

最後に、このリンクから解決策を得ました。
http://www.firedaemon.com/blog/passwordless-root-ssh-public-key-authentication-on-centos-6
クライアント マシンに SSH RSA キーを作成しました (つまり、SSH 接続元のマシン)そしてそれをリモートホストにコピーします。
.

于 2014-12-16T04:04:59.743 に答える