Sha256: 3eb01cfbc9f5965846d85a5e092687d772606980cecfbee40c18cb9e7d785690

Contents?: true

Size: 624 Bytes

Versions: 37

Compression:

Stored size: 624 Bytes

Contents

module ProxyAPI
  # ProxyAPI for Ansible
  class Ansible < ::ProxyAPI::Resource
    def initialize(args)
      @url = args[:url] + '/ansible/'
      super args
    end

    PROXY_ERRORS = [
      Errno::ECONNREFUSED,
      SocketError,
      Timeout::Error,
      Errno::EINVAL,
      Errno::ECONNRESET,
      EOFError,
      Net::HTTPBadResponse,
      Net::HTTPHeaderSyntaxError,
      Net::ProtocolError,
      RestClient::ResourceNotFound
    ].freeze

    def roles
      parse(get('roles'))
    rescue *PROXY_ERRORS => e
      raise ProxyException.new(url, e, N_('Unable to get roles from Ansible'))
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
foreman_ansible-1.5.2 app/lib/proxy_api/ansible.rb
foreman_ansible-1.5.1 app/lib/proxy_api/ansible.rb
foreman_ansible-1.5.0 app/lib/proxy_api/ansible.rb
foreman_ansible-2.1.0 app/lib/proxy_api/ansible.rb
foreman_ansible-2.0.1 app/lib/proxy_api/ansible.rb
foreman_ansible-2.0.0 app/lib/proxy_api/ansible.rb
foreman_ansible-1.4.6 app/lib/proxy_api/ansible.rb
foreman_ansible-1.4.5 app/lib/proxy_api/ansible.rb
foreman_ansible-1.4.3 app/lib/proxy_api/ansible.rb
foreman_ansible-1.4.2 app/lib/proxy_api/ansible.rb
foreman_ansible-1.4.1 app/lib/proxy_api/ansible.rb
foreman_ansible-1.4.0 app/lib/proxy_api/ansible.rb
foreman_ansible-1.3.1 app/lib/proxy_api/ansible.rb
foreman_ansible-1.3.0 app/lib/proxy_api/ansible.rb
foreman_ansible-1.2.1 app/lib/proxy_api/ansible.rb
foreman_ansible-1.2 app/lib/proxy_api/ansible.rb
foreman_ansible-1.1 app/lib/proxy_api/ansible.rb