plugins.filter.url packageΒΆ
SubmodulesΒΆ
plugins.filter.url.join moduleΒΆ
Ansible filter plugin that safely joins URL components from a list. - Requires a valid β<scheme>://β in the first element (any RFC-3986-ish scheme) - Preserves the double slash after the scheme, collapses other duplicate slashes - Supports query parts introduced by elements starting with β?β or β&β
first query element uses β?β, subsequent use β&β (regardless of given prefix)
each query element must be exactly one βkey=valueβ pair
query elements may only appear after path elements; once query starts, no more path parts
Raises specific AnsibleFilterError messages for common misuse
- plugins.filter.url.join.url_join(parts)ΒΆ
Join a list of URL parts, URL-aware (scheme, path, query).
- Parameters:
parts (list|tuple) β URL segments. First element MUST include β<scheme>://β. Path elements are plain strings. Query elements must start with β?β or β&β and contain exactly one βkey=valueβ.
- Returns:
Joined URL.
- Return type:
str
- Raises:
AnsibleFilterError β with specific, descriptive messages.
plugins.filter.url.to_onion moduleΒΆ
- plugins.filter.url.to_onion.to_onion_url(url: str, tor_node: str, primary_domain: str) strΒΆ
Rewrite a browser-facing clearnet URL to its
.onionmirror.When
tor_nodeis set (svc-net-tor deployed) and the URLβs host is theprimary_domainor a subdomain of it, swap that suffix fortor_nodeand force thehttpscheme (onion services are plaintext-only). Anything else β empty inputs, a host not underprimary_domain, an unparseable value β is returned unchanged, so the filter is a safe no-op on clearnet.