retr0h

be open minded, and always continue to learn

Public IP Address Discovery With Chef and Ohai

I am currently automating the deployment and configuration of a moderately complex service architecture. Ohai, currently has no way to discover a systems public (floating) ip address in an OpenStack environment. The ability to discover this information helps with additional automation (eg. Provisioning dns in DynECT).

This Ohai plugin is a semi-poor attempt at discovering a guest’s public ipaddress.

Update: Fri Nov 11 2011

Looks like Ohai already attempts to capture this information from the meta-data server. However, this fails due to MAC address not matching. Updated the previously discussed plugin to capture the floating IP from the meta-data server. Also, have it following the same API as the eucalyptus plugin.

https://github.com/opscode/ohai/blob/master/lib/ohai/plugins/eucalyptus.rb

Usage is as follows: