-
Notifications
You must be signed in to change notification settings - Fork 285
/
ansible_collection.rb
49 lines (41 loc) · 1.2 KB
/
ansible_collection.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require 'pulp_ansible_client'
module Katello
module Pulp3
class Repository
class AnsibleCollection < ::Katello::Pulp3::Repository
def self.api_client(smart_proxy)
PulpAnsibleClient::ApiClient.new(smart_proxy.pulp3_configuration(PulpAnsibleClient::Configuration))
end
def api_exception_class
PulpAnsibleClient::ApiError
end
def remote_class
PulpAnsibleClient::CollectionRemote
end
def remotes_api
PulpAnsibleClient::RemotesCollectionApi.new(api_client)
end
def distribution_class
PulpAnsibleClient::AnsibleDistribution
end
def distributions_api
PulpAnsibleClient::DistributionsAnsibleApi.new(api_client)
end
def remote_options
if root.url.blank?
super
else
common_remote_options.merge(url: root.url) # whitelist: root.ansible_collection_whitelist)
end
end
def distribution_options(path)
{
base_path: path,
repository_version: repo.version_href,
name: "#{backend_object_name}"
}
end
end
end
end
end