You can load/access arguments via environmental variables. For
example, if you wanted to pass in some IP addresses:
desc "Just spitting out some IPs from the command line"
task :spit_addresses do
ENV["ADDRESSES"].split(",").each {|a| puts a }
end
and then call it with:
cap spit_addresses ADDRESSES=10.0.0.1,10.0.0.2,10.0.0.3
it would puts:
10.0.0.1
10.0.0.2
10.0.0.3
Hope that helps.
On Jun 12, 2008, at 11:56 AM, shadowbq wrote:
>
> Is there any way to override the role members from the command line?
>
> ex.. (of course is wrong)
> cap uname_dbservers uname_webservers dbservers="10.0.0.1"
>
> ==== capfile ===
> [..snip..]
> role :dbservers = "10.0.0.2"
> role :webservers = "10.0.0.3"
>
> desc "create rule link on sguild server"
> task :uname_dbservers, :roles => :dbservers do
> sudo "uname -a"
> end
>
> desc "set dns server"
> task :whoami_webserver, :roles => :webservers do
> sudo "whoami"
> end
>
> ======
>
> I wish that it would leave the webservers role alone and run on the
> two servers 10.0.0.1 & 10.0.0.3.
>
> NOTE: If I use HOSTS="10.0.0.1" it will run the two commands only on
> the HOSTS only not the webservers role.
>
> =======
>
> Any dice ???
> >
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---