私はcapistranoを使ってコマンドを実行します。私はsshキーベースの認証を持っていますが、各マシンには異なるsudoパスワードがあります。私は次の出力を取得し、これを実行するとCapistrano、sudoコマンドと複数のパスワード
私capfileこの
default_run_options[:pty] = true
role :admin, "server1","server2","server3"
desc "myCommand"
task :mycommand, :roles=>:admin do
run "cd <workdir> && #{sudo} <command>"
end
次のようになります。
* executing `myCommand'
* executing "cd <workdir> && sudo -p 'sudo password: ' <command>"
servers: ["server1", "server2", "server3"]
[server2] executing command
[server3] executing command
Password:
** [out :: server2]
** [out :: server3]
[server1] executing command
** [out :: server1]
** [out :: server3] CMD-OUTPUT
*** [out :: server2] Sorry, try again.
** [out :: server2] Sorry, try again.
Password:
** [out :: server2]
** [out :: server1]
** [out :: server2] CMD-OUTPUT
** [out :: server1]
** [out :: server1] Sorry, try again.
** [out :: server1] sudo: 3 incorrect password attempts
command finished in 14411ms
failed: "sh -c 'cd <workdir> && sudo -p '\\''sudo password: '\\'' <command>'" on server1
どうやらカピストラーノは、私はすべてのサーバー上で同じpasswortを持っていることを前提としていることは可能ですか?どうすれば修正できますか?
この質問の回答を参照してください:http://stackoverflow.com/questions/8241639/multiple-server-deploy-asking-ssh-password-for-each-server –
私はすでに公開鍵のログイン設定をしていますが、私はsudoが必要です。どういうわけか私はランを「並行」にすることはできますか? –