dmac / fezzik

A light deployment system that takes care of the heavy lifting.
https://rubygems.org/gems/fezzik
MIT License
37 stars 6 forks source link

Don't require default setting when using roles #36

Closed dmac closed 11 years ago

dmac commented 12 years ago

Fezzik currently requires all variables overridden with role to have non-role defaults. For example: the following throws an exception:

destination :prod do
  role :root_user, :user => "root"
end

remote_task :setup, :roles => root_user do
  run "whoami"
end

# $ fez prod setup
# undefined method `user' for Fezzik:Module

To avoid the exception, fezzik currently requires all overridden variables to have a default. In this example:

set :user, "default"

This should be unnecessary.

cespare commented 11 years ago

Ah yeah, just ran into this. set :user, "asdfasdfa" fixed it :unamused:

cespare commented 11 years ago

This is now fixed on the weave branch. The way I did it is slightly intertwined (hehe) with the weave changes so I didn't feel like making it independently and having to merge it later.

dmac commented 11 years ago

Nice work!