Class: ForemanPuppet::HostInfoProviders::PuppetInfo
- Inherits:
-
HostInfo::Provider
- Object
- HostInfo::Provider
- ForemanPuppet::HostInfoProviders::PuppetInfo
- Defined in:
- app/services/foreman_puppet/host_info_providers/puppet_info.rb
Instance Method Summary collapse
Instance Method Details
#host_info ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'app/services/foreman_puppet/host_info_providers/puppet_info.rb', line 4 def host_info # Static parameters param = puppet_static_info info_hash = {} info_hash['classes'] = classes_info_hash info_hash['parameters'] = param info_hash['environment'] = param['foreman_env'] if Setting['enc_environment'] && param['foreman_env'].present? info_hash end |
#inherited_puppetclass_parameters ⇒ Object
27 28 29 30 31 |
# File 'app/services/foreman_puppet/host_info_providers/puppet_info.rb', line 27 def inherited_puppetclass_parameters keys = ForemanPuppet::PuppetclassLookupKey.includes(:environment_classes).parameters_for_class(host.puppet&.puppetclass_ids, host.puppet&.environment_id) keys.inherited_values(host).raw end |
#puppetclass_parameters ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/services/foreman_puppet/host_info_providers/puppet_info.rb', line 15 def puppetclass_parameters keys = ForemanPuppet::PuppetclassLookupKey.includes(:environment_classes).parameters_for_class(host.puppet&.puppetclass_ids, host.puppet&.environment_id) key_hash = hashed_class_keys(keys) values = keys.values_hash(host) klasses = {} host.puppet.classes.each do |klass| klasses[klass.name] = smart_class_params_for(klass, key_hash, values) end klasses end |