Sha256: 75804b95c3cc2570c892cca93c6e828d21f449477d35ebd8bcdcd01ad91feb6e

Contents?: true

Size: 483 Bytes

Versions: 76

Compression:

Stored size: 483 Bytes

Contents

module ForemanAnsible
  class AnsibleInfo < ::HostInfo::Provider
    def host_info
      { 'parameters' => ansible_params }
    end

    def ansible_params
      variables = AnsibleVariable.where(:ansible_role_id => host.all_ansible_roles.pluck(:id), :override => true)
      values = variables.values_hash(host)

      variables.each_with_object({}) do |var, memo|
        value = values[var]
        memo[var.key] = value unless value.nil?
        memo
      end
    end
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
foreman_ansible-15.0.2 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-15.0.1 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-15.0.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-14.2.2 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-14.2.1 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-13.0.7 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-14.2.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-14.1.1 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-14.1.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-13.0.5 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-14.0.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-13.0.4 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-13.0.3 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-13.0.2 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-13.0.1 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-13.0.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-12.0.7 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-10.4.4 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-7.1.8 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-12.0.6 app/services/foreman_ansible/ansible_info.rb