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-2.2.14 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.13 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.12 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.11 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.10 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.9 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.8 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.7 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.6 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.5 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.4 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.3 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.2 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.1 app/lib/proxy_api/ansible.rb
foreman_ansible-2.2.0 app/lib/proxy_api/ansible.rb
foreman_ansible-2.1.2 app/lib/proxy_api/ansible.rb
foreman_ansible-2.1.1 app/lib/proxy_api/ansible.rb
foreman_ansible-2.0.4 app/lib/proxy_api/ansible.rb
foreman_ansible-2.0.3 app/lib/proxy_api/ansible.rb
foreman_ansible-2.0.2 app/lib/proxy_api/ansible.rb