2 lib/facter/personality.rb | 21 ++++++++++++++++++
3 lib/facter/subfunction.rb | 61 ++++++++++++++++++++++++++++++++++++++++++++++
4 2 files changed, 82 insertions(+)
7 +++ b/lib/facter/personality.rb
12 +# This fact gives the personality of this node.
14 +require 'facter/util/file_read'
16 +Facter.add('personality') do
17 + confine :kernel => :linux
20 + if release = Facter::Util::FileRead.read('/etc/platform/platform.conf')
21 + if match = release.match(/^nodetype\=(.*)/)
28 +# vim: set ts=2 sw=2 et :
31 +++ b/lib/facter/subfunction.rb
36 +# This fact gives the subfunction of this node.
38 +require 'facter/util/file_read'
40 +Facter.add('subfunction') do
41 + confine :kernel => :linux
44 + if release = Facter::Util::FileRead.read('/etc/platform/platform.conf')
45 + if match = release.match(/^subfunction\=(.*)/)
52 +Facter.add('is_worker_subfunction') do
53 + confine :kernel => :linux
56 + if release = Facter::Util::FileRead.read('/etc/platform/platform.conf')
57 + match = release.match(/^subfunction\=.*worker/) ? true : false
62 +Facter.add('is_controller_subfunction') do
63 + confine :kernel => :linux
66 + if release = Facter::Util::FileRead.read('/etc/platform/platform.conf')
67 + match = release.match(/^subfunction\=.*controller/) ? true : false
72 +Facter.add('is_storage_subfunction') do
73 + confine :kernel => :linux
76 + if release = Facter::Util::FileRead.read('/etc/platform/platform.conf')
77 + match = release.match(/^subfunction\=.*storage/) ? true : false
82 +Facter.add('is_lowlatency_subfunction') do
83 + confine :kernel => :linux
86 + if release = Facter::Util::FileRead.read('/etc/platform/platform.conf')
87 + match = release.match(/^subfunction\=.*lowlatency/) ? true : false
92 +# vim: set ts=2 sw=2 et :