wolverian / box

box! is full of boxes
ISC License
6 stars 1 forks source link

Add support for description of boxes to be printed in for ls #7

Closed deiga closed 11 years ago

wolverian commented 11 years ago

Could you give me an example of what kind of descriptions you would use for your boxes? I want to make sure I understand your use case. I can imagine using descriptions myself, but let's see if our ideas are really the same.

In addition to the descriptions themselves, how would you like to configure them? Put them in etc/hosts? What kind of syntax would you like to see?

deiga commented 11 years ago
foo@bar.baz, hostname: 'bar', description: 'This box is the shared box for out Bar friends. I have sudo access. I maintain MySQL and Trac on this box'
wolverian commented 11 years ago

Thanks for the description. I will think about this. I want to keep the format of the hosts file as simple as possible, and keep it open for future extension. We could even think about splitting the hosts file into separate directories per host. (E.g. etc/hosts/foo.bar.com/{config,description,…}.

should be able to use ssh-config information when it connects

This should work right now. SSH config information from ~/.ssh/config should be read automatically by SSH. Did I misunderstand you?

deiga commented 11 years ago

Ah, no. I was just a bit too unspecific :)

In the example below the config is only used if you connect to ssh this-is-not-bar, so that is what I mean with specifying the hostname to use

Host this-is-not-bar
    Hostname bar.com
    User foo
wolverian commented 11 years ago

Ah, I understand now. This used to “just work” because all tasks were SSH based. Now when we have ping and such, we can not use SSH aliases directly. I’ll try to find a good solution. Thanks again!

wolverian commented 11 years ago

Commit 7a2e91a enables you to add comments to the etc/hosts file. This allows you to add simple comments describing your hosts. box ls will print these comments:

$ box ls
iv@signal.wolverian.net # foo bar
iv@lilo.wolverian.net   # quux
test@wolverian.net  # something else

Does this satisfy your immediate use case? I will add a separate bug about the SSH aliases.

wolverian commented 11 years ago

Added SSH aliases as #11.