| | 3 | == New facts testing == |
| | 4 | While you are writing new facts please refer to [http://docs.puppetlabs.com/guides/custom_facts.html puppetlabs documentation]. In short do something like: |
| | 5 | {{{ |
| | 6 | $ mkdir -p ~/lib/ruby/facter ; export RUBYLIB=~/lib/ruby |
| | 7 | $ cp /path/to/hardware_platform.rb $RUBYLIB/facter |
| | 8 | $ facter hardware_platform |
| | 9 | SUNW,Sun-Blade-1500 |
| | 10 | }}} |
| | 11 | |
| | 12 | == New facts distributing == |
| | 13 | To distribute your new facts to puppet clients make a module (preferably the one where you are using this fact, e.g. |
| | 14 | {{{ |
| | 15 | $ mkdir -p /etc/puppet/modules/myfirst_module/lib/facter |
| | 16 | cp myfirstfact.rb /etc/puppet/modules/myfirst_module/lib/facter |
| | 17 | }}} |
| | 18 | |
| | 19 | If you are distributing facts this way you can test them on the client by setting FACTERLIB environment variable: |
| | 20 | {{{ |
| | 21 | export FACTERLIB=/var/lib/puppet/lib/facter |
| | 22 | facter |
| | 23 | }}} |