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-6.3.2 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-6.3.1 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-6.4.1 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-6.4.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-6.3.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-6.2.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-6.1.1 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-6.0.2 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-6.1.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-6.0.1 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-5.1.3 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-6.0.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-5.1.2 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-5.1.1 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-5.1.0 app/services/foreman_ansible/ansible_info.rb
foreman_ansible-5.0.1 app/services/foreman_ansible/ansible_info.rb