Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal sprinkle script #109

Closed
kimptoc opened this issue May 27, 2013 · 4 comments
Closed

Minimal sprinkle script #109

kimptoc opened this issue May 27, 2013 · 4 comments

Comments

@kimptoc
Copy link
Contributor

kimptoc commented May 27, 2013

Hi,

I posted this on stackoverflow, but probably should be here:
http://stackoverflow.com/questions/16770540/sprinkle-script-is-giving-me-this-error-policy-myapp-is-to-be-installed-on-app

I am trying to get started with sprinkle, using this minimal script:

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

But I get this error:

"Policy myapp is to be installed on :app but no server has such a role."

Which implies to me that I have my role line in the wrong place. I tried defining role outside of things - but then I get role is undefined.

The current exception is:

$ 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>'
@kimptoc
Copy link
Contributor Author

kimptoc commented May 27, 2013

I managed to get it working by changing the policy roles to be a string rather than a symbol:

policy :myapp, :roles => "app" do

I am working with ruby 2.0.0 and 1.9.3(p429)

@joshgoebel
Copy link
Contributor

This should go out in 0.6 which I hope to push soon.

@joshgoebel
Copy link
Contributor

Fix: 87f084f

@kimptoc
Copy link
Contributor Author

kimptoc commented May 27, 2013

Great - thanks for the quick reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants