Class: Oxford::Runner
- Inherits:
-
Object
- Object
- Oxford::Runner
- Defined in:
- lib/oxford/runner.rb
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
-
.debug ⇒ Object
Returns the value of attribute debug.
Class Method Summary collapse
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
3 4 5 |
# File 'lib/oxford/runner.rb', line 3 def config @config end |
.debug ⇒ Object
Returns the value of attribute debug.
3 4 5 |
# File 'lib/oxford/runner.rb', line 3 def debug @debug end |
Class Method Details
.run! ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/oxford/runner.rb', line 7 def self.run! Oxford::LDAPAdapter.new # should run the fact retrievers @facts = Oxford::Facts.new @host = Oxford::Host.find(@facts.hostname) if @host.is_a?(Array) @host = Oxford::Host.new(@facts.hostname) end @host.save # Set facts provided by Facter. @facts.all.each do |fact, value| f = fact.gsub(/_/, '') if @host.respond_to?("fact#{f}") @host.__send__("fact#{f}=", value.to_s) else puts "fact #{f} not being recorded as there is no corresponding entry in the data store" if @debug end end # Set Processor Info @facts.processors.each do |fact, value| @host.add_processor(fact, value) end # Set Network Info @facts.networks.each do |interface, value| @host.add_network(interface, value) end @host.update! end |