Skip to content

Instantly share code, notes, and snippets.

@h0tw1r3
Created July 23, 2016 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h0tw1r3/11863842809dee2c9226eef09ab88522 to your computer and use it in GitHub Desktop.
Save h0tw1r3/11863842809dee2c9226eef09ab88522 to your computer and use it in GitHub Desktop.
Puppet 4+ snippets
$facts['networking']['interfaces'].each() |$name, $values| {
$bindings = $values.filter |$key,$value| {
$key =~ /^bindings6?$/
}
$bindings.each |$bindingtype,$addresses| {
$addresses.each |$value| {
notice( "${name} with ip ${value['address']}" )
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment