2014-01-05 32 views
1

我想將用戶的角色設置爲我的Capistrano文件中的其中一個角色。我怎麼做?現在用戶被設置爲所有服務器的「sshadmin」。如何在Capistrano的服務器上使用不同的用戶?

set :user, "sshadmin" 

server "198.227.6.30", :app 
server "192.9.1.17", :web 
server "192.9.31.9", :db #I want this to use the user "sshadmin2" 

回答

0

Capistrano documentation

服務器可以在一堆的方式來定義,下面顯示定義兩臺服務器,一個我們在那裏設置用戶名,另一個我們設置端口。這些主機字符串被解析並在向外擴張的服務器產品線的評論後,相當於:

role :web, %w{[email protected] example.com:1234} 
# ...is the same as doing... 
server 'world.com' roles: [:web], user: 'hello' 
server 'example.com', roles: [:web], port: 1234 

適用於你的情況

role :db, %w{[email protected]} 
相關問題