Debian Codegraph @

lib/ansible/plugins/test/uri.yml

raw
1 DOCUMENTATION:
2 name: uri
3 author: Ansible Core
4 version_added: "2.14"
5 short_description: is the string a valid URI
6 description:
7 - Validates that the input string conforms to the URI standard, optionally that is also in the list of schemas provided.
8 options:
9 _input:
10 description: Possible URI.
11 type: string
12 required: True
13 schemes:
14 description: Subset of URI schemas to validate against, otherwise B(any) scheme is considered valid.
15 type: list
16 elements: string
17 required: False
18 EXAMPLES: |
19 # URLs are URIs
20 {{ 'http://example.com' is uri }}
21 # but not all URIs are URLs
22 {{ 'mailto://[email protected]' is uri }}
23 # looking only for file transfers URIs
24 {{ 'mailto://[email protected]' is not uri(schemes=['ftp', 'ftps', 'sftp', 'file']) }}
25 # make sure URL conforms to the 'special schemas'
26 {{ 'http://nobody:[email protected]' is uri(['ftp', 'ftps', 'http', 'https', 'ws', 'wss']) }}
27 RETURN:
28 _value:
29 description: Returns V(false) if the string is not a URI or the schema extracted does not match the supplied list.
30 type: boolean