Skip to content

Instantly share code, notes, and snippets.

@kbarber
Created February 6, 2012 02:31
Show Gist options
  • Save kbarber/1749041 to your computer and use it in GitHub Desktop.
Save kbarber/1749041 to your computer and use it in GitHub Desktop.
Structured Facts
[ken@kb test]# ~/Development/facter/bin/facter networking
---
interfaces:
lo0:
ip:
addresses:
- 127.0.0.1
status: active
en0:
status: inactive
[ken@kb test]# cat foo.pp
$a = $::networking['interfaces']['lo0']['ip']['addresses'][0]
notice($a)
$b = $::networking['interfaces']['lo0']['status']
notice($b)
[ken@kb test]# ~/Development/puppet/bin/puppet apply foo.pp
notice: Scope(Class[main]): 127.0.0.1
notice: Scope(Class[main]): active
notice: Finished catalog run in 0.05 seconds
[ken@kb test]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment