Here's what I do for HP's OpenStack (disclaimer: HP employee), although it requires the new hinting system in a release candidate version of the ohai gem. If you create a hint for openstack (i.e touch /etc/chef/ohai/hints/openstack.json
) then it should work just as well.
$ sudo gem install ohai --version 6.18.0.rc.1
$ sudo mkdir -p /etc/chef/ohai/hints
$ sudo touch /etc/chef/ohai/hints/hp.json
$ sudo ohai
[lots deleted]
"cloud": {
"public_ipv4": "15.185.XXX.XXX",
"private_ips": [
"10.4.XXX.XXX"
],
"public_ips": [
"15.185.XXX.XXX"
],
"local_ipv4": "10.4.XX.XXX",
"provider": "hp",
"local_hostname": "precise",
"public_hostname": "precise"
}
This is using this Chef Omnibus installer. If you're using the opscode Ubuntu packages then it could be a little more difficult to get going.