Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plugins/doc_fragments/pulp.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ class ModuleDocFragment(object):
- If no value is specified, the value of the environment variable C(SQUEEZER_VALIDATE_CERTS) will be used as a fallback.
type: bool
default: true
api_root:
description:
- The path to the API root of the Pulp server.
- The value must begin and end with C(/).
- If no value is specified, the value of the environment variable C(SQUEEZER_API_ROOT) will be used as a fallback.
type: str
default: "/pulp/"
refresh_api_cache:
description:
- Whether the cached API specification should be invalidated.
Expand Down
10 changes: 9 additions & 1 deletion plugins/module_utils/pulp_glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def __init__(self, **kwargs):
"default": True,
"fallback": (env_fallback, ["SQUEEZER_VALIDATE_CERTS"]),
},
"api_root": {
"type": "str",
"default": "/pulp/",
"fallback": (env_fallback, ["SQUEEZER_API_ROOT"]),
},
"refresh_api_cache": {"type": "bool", "default": False},
"timeout": {"type": "int", "default": 3600},
}
Expand Down Expand Up @@ -86,6 +91,9 @@ def __init__(self, **kwargs):
if import_error[1] is not None:
self.fail_json(msg=missing_required_lib(import_error[0]), exception=import_error[1])

if not self.params["api_root"].startswith("/") or not self.params["api_root"].endswith("/"):
self.fail_json(msg="'api_root' must begin and end with '/'")

auth_args = {}
if self.params["username"]:
auth_args["auth_provider"] = BasicAuthProvider(
Expand All @@ -94,7 +102,7 @@ def __init__(self, **kwargs):
)

self.pulp_ctx = PulpContext(
api_root="/pulp/",
api_root=self.params["api_root"],
api_kwargs=dict(
base_url=self.params["pulp_url"],
cert=self.params["user_cert"],
Expand Down
Loading