sprinkle-tool / sprinkle

Sprinkle is a software provisioning tool you can use to build remote servers with. eg. to install a Rails, or Sinatra stack on a brand new slice directly after its been created
https://github.com/sprinkle-tool/sprinkle
MIT License
1.15k stars 138 forks source link

execute_on_role - undefined method #78

Closed Rainfellow2002 closed 11 years ago

Rainfellow2002 commented 11 years ago

Dear all,

I am following this simple tutorial at http://engineering.gomiso.com/2011/08/26/forget-chef-or-puppet-automate-with-sprinkle/ and test script at the bottom of the page and when i run the script i get the following error message:

--> Cloud hierarchy for policy myapp

Policy myapp requires package git

--> Normalized installation order for all packages: git --> Checking if git is already installed for roles: app --> Verifying git... /usr/local/sprinkle/lib/sprinkle/actors/ssh.rb:69:in execute_on_role': undefined method[]' for nil:NilClass (NoMethodError)

I've changed capistrano to ssh like so: deployment do delivery :ssh

source do prefix '/usr/local' archives '/usr/local/sources' builds '/usr/local/build' end end

Rainfellow2002 commented 11 years ago

I figured it out myself, you get the following error when you try to run the 'install.rb' script from a location other than where 'install.rb' and 'deploy.rb' resides. For example:

My sprinkle scripts are in: /etc/sprinkle/deploy.rb /etc/sprinkle/install.rb /etc/sprinkle/packages/...

If I'm at /etc/sprinkle and start the script with 'sprinkle -c -s install.rb' everything goes fine. If I'm at for example /root and start the script with 'sprinkle -c -s /etc/sprinkle/install.rb' i get the error stated above.

Cheers