Sha256: 8ca416984ece163290c2375b5cf780f270aa89c3764bf8cc831932df33e10485

Contents?: true

Size: 612 Bytes

Versions: 5

Compression:

Stored size: 612 Bytes

Contents

module ForemanAnsible
  # Contains proxy selection rules for a host playbook run
  class ProxySelector < ::ForemanTasks::ProxySelector
    def available_proxies(host)
      proxies = {}
      proxies[:fallback] = host.smart_proxies.with_features('Ansible')
      proxies[:global] = proxy_scope(host).authorized.with_features('Ansible')
      proxies
    end

    private

    def proxy_scope(host)
      return ::SmartProxy unless Taxonomy.enabled_taxonomies.any?
      ::SmartProxy.with_taxonomy_scope_override(host.location,
                                                host.organization)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_ansible-1.3.1 app/services/foreman_ansible/proxy_selector.rb
foreman_ansible-1.3.0 app/services/foreman_ansible/proxy_selector.rb
foreman_ansible-1.2.1 app/services/foreman_ansible/proxy_selector.rb
foreman_ansible-1.2 app/services/foreman_ansible/proxy_selector.rb
foreman_ansible-1.1 app/services/foreman_ansible/proxy_selector.rb