我正在尝试洒水,但遇到了第一个障碍 - 出现此错误:
“策略 myapp 将安装在 :app 上,但没有服务器具有这样的作用。”
这是我的脚本:
package :ubuntu_version do
runner "lsb_release -r"
end
policy :myapp, :roles => :app do
requires :ubuntu_version
end
deployment do
delivery :ssh do
user 'root'
password 'secret'
role :app, 'server'
end
end
这是完整的错误:
$ sprinkle -c -s install_kimptoc2.rb
/Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/gems/sprinkle-0.5.2/lib/sprinkle/policy.rb:87:in `process': Policy myapp is to be installed on :app but no server has such a role. (Sprinkle::Policy::NoMatchingServersError)
from /Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/gems/sprinkle-0.5.2/lib/sprinkle/deployment.rb:79:in `block in process'
from /Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/gems/sprinkle-0.5.2/lib/sprinkle/deployment.rb:78:in `each'
from /Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/gems/sprinkle-0.5.2/lib/sprinkle/deployment.rb:78:in `process'
from /Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/gems/sprinkle-0.5.2/lib/sprinkle/script.rb:20:in `sprinkle'
from /Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/gems/sprinkle-0.5.2/lib/sprinkle/script.rb:16:in `sprinkle'
from /Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/gems/sprinkle-0.5.2/bin/sprinkle:108:in `<top (required)>'
from /Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/bin/sprinkle:19:in `load'
from /Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/bin/sprinkle:19:in `<main>'
from /Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/kimptoc/.rvm/gems/ruby-1.9.3-p429@p-box-mgr/bin/ruby_noexec_wrapper:14:in `<main>'