Skip to content

Instantly share code, notes, and snippets.

@maraca
Created August 24, 2014 12:48
Show Gist options
  • Save maraca/a9fea217e975ab681cbf to your computer and use it in GitHub Desktop.
Save maraca/a9fea217e975ab681cbf to your computer and use it in GitHub Desktop.
search for a statsd node using chef-zero and kitchen-ci
environment = node.chef_environment
role = 'statsd'
# search for statsd host
statsd_host = search(:node, "roles:#{role} AND chef_environment:#{environment}").sort.first
puts statsd_host['ipaddress']
> 10.0.0.75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment