Class: ForemanAnsible::StructuredFactImporter

Inherits:
StructuredFactImporter
  • Object
show all
Defined in:
app/services/foreman_ansible/structured_fact_importer.rb

Overview

On 1.13+ , use the parser for structured facts (like Facter 2) that comes from core

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, facts = {}) ⇒ StructuredFactImporter

Returns a new instance of StructuredFactImporter.



13
14
15
16
17
18
19
20
21
# File 'app/services/foreman_ansible/structured_fact_importer.rb', line 13

def initialize(host, facts = {})
  # Try to assign these facts to the correct host as per the facts say
  # If that host isn't created yet, the host parameter will contain it
  @host = Host.find_by(:name => facts[:ansible_facts][:ansible_fqdn] ||
                                facts[:ansible_facts][:fqdn]) ||
          host
  @facts = normalize(facts[:ansible_facts])
  @counters = {}
end

Class Method Details

.authorized_smart_proxy_featuresObject



9
10
11
# File 'app/services/foreman_ansible/structured_fact_importer.rb', line 9

def self.authorized_smart_proxy_features
  'Ansible'
end

Instance Method Details

#fact_name_classObject



5
6
7
# File 'app/services/foreman_ansible/structured_fact_importer.rb', line 5

def fact_name_class
  ForemanAnsible::FactName
end