chrisroberts / vagabond

Advocating idleness and work-shyness
Other
233 stars 25 forks source link

Wondering how to set a node's container IP address... #18

Closed jaypipes closed 11 years ago

jaypipes commented 11 years ago

Hi!

How do I manually set the IP address for my node's LXC container? I need to do things in my test roles and test environment that, for example, set a nagios server hostname to the address of my "ops" node in the Vagrantfile. But I can't seem to figure out how to ensure a particular IP address is given to a particular node.

Thanks! -jay

chrisroberts commented 11 years ago

Sure:

# Vagabondfile
{
  :nodes => {
    :my_node => {
      :ipaddress => '10.0.3.201',
      :other_stuff => 'etc etc...'
    }
  }
}
jaypipes commented 11 years ago

Heh... well that was easy :) Thanks, Chris!

jaypipes commented 11 years ago

As a followup, if I wanted to specify the network interfaces to set up in the underlying LXC container, should I do that:

chrisroberts commented 11 years ago

Ideally this should be done through the Vagabondfile, using sub-resource primitives defined by the LXC cookbook. Definitely easier said than done. @spheromak and I actually had a conversation about it last month, and my final take for a solution was to provide a method to build sub-resource blocks in the Vagabondfile that could be shipped to the recipes for use when provisioning the host node. The underlying parts required to support this are working, and now it's just a matter of wiring things up.

I'll open a ticket for the feature so it can be tracked.

chrisroberts commented 11 years ago

22 for reference