Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

More convenient way to find the current host #32

bkad opened this Issue Jun 6, 2012 · 2 comments


None yet
3 participants

bkad commented Jun 6, 2012

This is to track the conversation we had today about making Fezzik easier to use.

There needs to be a convenient way to find out in a task the environment variables set for the current host deployed to. As far as I can tell, the only way of doing this is the following:


And that only works for remote tasks. So non-remote tasks (like the ones that write out the environment.rb/sh files) won't be able to reliably figure out which is the current target host.

The workaround for this seems to be making tasks that need to know about the current target host to be remote and include the above code snippet to fetch that host's environment.


cespare commented Jun 6, 2012

There is no such thing as the "current target host" for non-remote tasks. These are only executed once, not once per target host, like remote tasks are.

Edit: That's why tasks like the one that writes out the environment files have to iterate through every target host.

Edit 2: I agree, though, that it would be nice to have one-word methods to get the current target host (for remote tasks) and the list of hosts (for regular tasks) that is guaranteed to either have or not have the user@ portion, regardless of how domain was set.


bkad commented Jun 6, 2012

Ah, I see. I guess it felt weird writing remote tasks that don't run any remote commands. Fair enough.

A small Fezzik way to get the current environment still might be nice, I think it would make things clearer.

@dmac dmac closed this Nov 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment