init
This commit is contained in:
commit
c5cd492449
475 changed files with 27928 additions and 0 deletions
7
technology/tools/Ansible/tests/Ansible Test Plugins.md
Normal file
7
technology/tools/Ansible/tests/Ansible Test Plugins.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Ansible Test Plugins
|
||||
Ansible Test Plugins let you check a variable on a condition.
|
||||
|
||||
- [ansible.builtin.exists](ansible.builtin.exists.md)
|
||||
- [ansible.builtin.success](ansible.builtin.success.md)
|
||||
- [ansible.builtin.url](ansible.builtin.url.md)
|
||||
- [ansible.builtin.search](ansible.builtin.search.md)
|
9
technology/tools/Ansible/tests/ansible.builtin.exists.md
Normal file
9
technology/tools/Ansible/tests/ansible.builtin.exists.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# ansible.builtin.exists
|
||||
Check if the provided path maps to an existing filesystem object on the controller (localhost).
|
||||
|
||||
## Examples
|
||||
```yml
|
||||
vars:
|
||||
my_etc_hosts_exists: "{{ '/etc/hosts' is exist }}"
|
||||
list_of_local_files_to_copy_to_remote: "{{ list_of_all_possible_files | select('exists') }}"
|
||||
```
|
16
technology/tools/Ansible/tests/ansible.builtin.search.md
Normal file
16
technology/tools/Ansible/tests/ansible.builtin.search.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# ansible.builtin.search
|
||||
Compare string against regular expression using Python’s `search` function.
|
||||
|
||||
## Parameters
|
||||
| Parameter | Type | Description |
|
||||
| -------------- | -------------------------- | --------------------------------------- |
|
||||
| **ignorecase** | boolean (default: `false`) | Use case insenstive matching. |
|
||||
| **multiline** | boolean (default: `false`) | Match against multiple lines in string. |
|
||||
| **pattern** | string / required | Regex to match against. |
|
||||
|
||||
## Examples
|
||||
```yml
|
||||
url: "https://example.com/users/foo/resources/bar"
|
||||
foundmatch: url is search("https://example.com/users/.*/resources")
|
||||
alsomatch: url is search("users/.*/resources")
|
||||
```
|
|
@ -0,0 +1,8 @@
|
|||
# ansible.builtin.success
|
||||
Tests if task finished successfully, opposite of `failed`. Input is a registered result from an Ansible task.
|
||||
|
||||
## Example
|
||||
```yml
|
||||
# test 'status' to know how to respond
|
||||
{{ taskresults is success }}
|
||||
```
|
19
technology/tools/Ansible/tests/ansible.builtin.url.md
Normal file
19
technology/tools/Ansible/tests/ansible.builtin.url.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# ansible.builtin.url
|
||||
Validates a string to conform to the URL standard.
|
||||
|
||||
## Parameters
|
||||
| Parameter | Type | Description |
|
||||
| ----------- | ---------------------- | ---------------------------------------------------------------------------------------- |
|
||||
| **schemes** | list / elements=string | Subset of URI schemas to validate against, otherwise **any** scheme is considered valid. |
|
||||
|
||||
## Examples
|
||||
```yml
|
||||
# simple URL
|
||||
{{ 'http://example.com' is url }}
|
||||
# looking only for file transfers URIs
|
||||
{{ 'mailto://nowone@example.com' is not uri(schemes=['ftp', 'ftps', 'sftp', 'file']) }}
|
||||
# but it is according to standard
|
||||
{{ 'mailto://nowone@example.com' is not uri }}
|
||||
# more complex URL
|
||||
{{ 'ftp://admin:secret@example.com/path/to/myfile.yml' is url }}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue