Sha256: 958cfeebf7523603a7f19d19af5357b42f5cd74218db314dd9a3d6ae0332bb28

Contents?: true

Size: 542 Bytes

Versions: 51

Compression:

Stored size: 542 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
        if ansible_proxy.blank?
          raise ::Foreman::Exception.new(N_('Proxy not found'))
        end
        @proxy_api = ::ProxyAPI::Ansible.new(:url => ansible_proxy.url)
      end

      def proxy_api
        return @proxy_api if @proxy_api
        find_proxy_api
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
foreman_ansible-7.0.4 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-7.0.3 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-7.0.2 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-7.0.1 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-7.0.0 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.3.4 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.3.3 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.3.2 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.3.1 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.4.1 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.4.0 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.3.0 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.2.0 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.1.1 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.0.2 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.1.0 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.0.1 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-5.1.3 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-6.0.0 app/services/foreman_ansible/proxy_api.rb
foreman_ansible-5.1.2 app/services/foreman_ansible/proxy_api.rb