Sha256: 10d17c849949ef054defafd8ace686e86d943cf0905716f9cd36baf3102d7f53

Contents?: true

Size: 775 Bytes

Versions: 46

Compression:

Stored size: 775 Bytes

Contents

# frozen_string_literal: true

module ForemanAnsible
  # On 1.13+ , use the parser for structured facts (like Facter 2) that comes
  # from core
  class StructuredFactImporter < ::StructuredFactImporter
    def fact_name_class
      ForemanAnsible::FactName
    end

    def self.authorized_smart_proxy_features
      'Ansible'
    end

    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
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
foreman_ansible-4.0.3.2 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-5.0.1 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-4.0.5 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-4.0.3.1 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-4.0.4 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-5.0.0 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-4.0.3 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-4.0.2 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-4.0.0 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-3.0.9 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-3.0.8 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-3.0.7 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-3.0.6 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-3.0.5 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-3.0.4 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-3.0.3 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-2.3.6 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-2.3.5 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-2.3.4 app/services/foreman_ansible/structured_fact_importer.rb
foreman_ansible-3.0.2 app/services/foreman_ansible/structured_fact_importer.rb