Class: RundeckFormatter
- Inherits:
-
Object
- Object
- RundeckFormatter
- Defined in:
- app/services/rundeck_formatter.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Instance Method Summary collapse
-
#initialize(host) ⇒ RundeckFormatter
constructor
A new instance of RundeckFormatter.
- #output ⇒ Object
Constructor Details
#initialize(host) ⇒ RundeckFormatter
Returns a new instance of RundeckFormatter.
7 8 9 |
# File 'app/services/rundeck_formatter.rb', line 7 def initialize(host) @host = host end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
2 3 4 |
# File 'app/services/rundeck_formatter.rb', line 2 def host @host end |
Instance Method Details
#output ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/services/rundeck_formatter.rb', line 11 def output = puppetclasses_names.map { |k| "class=#{k}" } unless params['rundeckfacts'].empty? += params['rundeckfacts'].gsub(/\s+/, '').split(',').map { |rdf| "#{rdf}=" + (facts_hash[rdf] || 'undefined') } end {name => {'description' => comment, 'hostname' => name, 'nodename' => name, 'Environment' => environment.name, 'osArch' => arch.name, 'osFamily' => os.family, 'osName' => os.name, 'osVersion' => os.release, 'tags' => , 'username' => params['rundeckuser'] || 'root'} } rescue => e logger.warn "Failed to fetch rundeck info for #{to_s}: #{e}" {} end |