Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Identify current host
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Gary Richardson  
View profile   Translate to Translated (View Original)
 More options 6 July, 16:06
From: Gary Richardson <gary.richard...@gmail.com>
Date: Mon, 6 Jul 2009 08:06:21 -0700
Local: Mon 6 July 2009 16:06
Subject: Re: [capistrano] Re: Identify current host

Hmm. That's odd..$CAPISTRANO:HOST$ wasn't working for me on Friday. Must be
them gremlins.
Is there another variable I can use to get the current host in the ruby
code? This is what I'm trying to do:

  task :bootstrap, :roles => [:master] do
        # instanceids is an array containing hostname => instanceid
id = instanceids["$CAPISTRANO:HOST$"]
run "register_host -H $CAPISTRANO:HOST$ -s #{id}"
  end

Obviously, $CAPISTRANO:HOST$ doesn't interpolate on the id = instanceids[]
line.

Thanks!

On Mon, Jul 6, 2009 at 3:31 AM, Rafael G. <r...@aspgems.com> wrote:

> Gary Richardson wrote:
> > Hey,

> > Two part question that I haven't been able to answer:

> > 1) can I get the current host a task is executing on? I've read some
> > stuff about $CAPISTRANO:HOST$, but it doesn't seem to work for me
> I tested this task and works for me:

>    task :host_name do
>        run "host $CAPISTRANO:HOST$"
>    end

> What OS are you using? Could you paste your deploy.rb in
> someplace(gist.github, pastie,...)?

> > 2) if I have an array of values (let's say an array that maps ec2 host
> > names to ec2 instance id's), can I use this same method to look up
> > something from that array?
> Capistrano uses ruby If you can do it with ruby you can do the same in a
> capistrano task.

> --
> Rafa


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google