Sha256: c6248b4bc3decdb7abd5e30f78f979a874ffceaf06c7c55d5b70306e0b89de05

Contents?: true

Size: 534 Bytes

Versions: 53

Compression:

Stored size: 534 Bytes

Contents

# frozen_string_literal: true

module ForemanAnsible
  # Helper methods to create a ProxyAPI object for Ansible
  module ProxyAPI
    extend ActiveSupport::Concern

    included do
      attr_reader :ansible_proxy

      def find_proxy_api(ansible_proxy)
        if ansible_proxy.blank?
          raise ::Foreman::Exception.new(N_('Proxy not found'))
        end
        ::ProxyAPI::Ansible.new(:url => ansible_proxy.url)
      end

      def proxy_api
        @proxy_api ||= find_proxy_api(ansible_proxy)
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

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