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

class plugins.filter.url.join.FilterModuleΒΆ

Bases: object

filters()ΒΆ
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ΒΆ

class plugins.filter.url.to_onion.FilterModuleΒΆ

Bases: object

filters()ΒΆ
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 .onion mirror.

When tor_node is set (svc-net-tor deployed) and the URL’s host is the primary_domain or a subdomain of it, swap that suffix for tor_node and force the http scheme (onion services are plaintext-only). Anything else β€” empty inputs, a host not under primary_domain, an unparseable value β€” is returned unchanged, so the filter is a safe no-op on clearnet.

Module contentsΒΆ