Jamis, correct me if I'm wrong, but I believe the only way to really
get variables into cap is to pass them on the command line (they're
essentially one-off environment variables).

$> cap my_task TARGET_HOST=mytargethost.com

Then, in your cap script, you'd have:

role :comps, ENV['TARGET_HOST']

-John

On Jun 9, 12:19 pm, Johnnie Walker <[EMAIL PROTECTED]> wrote:
> Thanks Jamis,
>
> What I am trying to do is something like this:
>
> x = "#{target_host.com}"
>   role :comps, x
>
> where target_host.com is a passed in parameter not a value already in
> the script.
>
> Thanks
>
> JT.
>
> On Jun 9, 4:58 pm, Jamis Buck <[EMAIL PROTECTED]> wrote:
>
> > Do you mean something like:
>
> >   x = "target_host.com"
> >   role :comps, x
>
> > ?
>
> > Then, yes, you can do that :) It's all just Ruby code, so whatever is
> > legal Ruby syntax, is also legal in a capfile.
>
> > If I misunderstood, please let me know. A more concrete use-case would
> > be helpful, too, to know what you need the feature for.
>
> > - Jamis
>
> > Johnnie Walker wrote:
> > > Hi guys, newbie question here....
>
> > > role :comps, "target_host.com"
>
> > > Is it possible to pass the value "target_host.com" from the line above
> > > as a variable/parameter so it is not hard-coded?
>
> > > Thanks in advance
>
> > > JT.
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to