init
This commit is contained in:
commit
c5cd492449
475 changed files with 27928 additions and 0 deletions
32
technology/tools/Ansible/lookups/ansible.builtin.url.md
Normal file
32
technology/tools/Ansible/lookups/ansible.builtin.url.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# ansible.builtin.url
|
||||
Returns the content of the URL requested to be used as data in play.
|
||||
|
||||
## Parameters
|
||||
| Parameter | Type | Description |
|
||||
| ------------------ | ------------------------- | ---------------------------------------------------------------------------------- |
|
||||
| **headers** | dictionary | HTTP request headers |
|
||||
| **password** | string | Password to use for HTTP authentication. |
|
||||
| **split_lines** | boolean (Default: `true`) | Flag to control if content is returned as a list of lines or as a single text blob |
|
||||
| **username** | string | Username to use for HTTP authentication. |
|
||||
| **validate_certs** | boolean (Default: `true`) | Flag to control SSL certificate validation |
|
||||
|
||||
## Examples
|
||||
```yml
|
||||
- name: url lookup splits lines by default
|
||||
ansible.builtin.debug: msg="{{item}}"
|
||||
loop: "{{ lookup('ansible.builtin.url', 'https://github.com/gremlin.keys', wantlist=True) }}"
|
||||
|
||||
- name: display ip ranges
|
||||
ansible.builtin.debug: msg="{{ lookup('ansible.builtin.url', 'https://ip-ranges.amazonaws.com/ip-ranges.json', split_lines=False) }}"
|
||||
|
||||
- name: url lookup using authentication
|
||||
ansible.builtin.debug: msg="{{ lookup('ansible.builtin.url', 'https://some.private.site.com/file.txt', username='bob', password='hunter2') }}"
|
||||
|
||||
- name: url lookup using basic authentication
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ lookup('ansible.builtin.url', 'https://some.private.site.com/file.txt', username='bob', password='hunter2', force_basic_auth='True') }}"
|
||||
|
||||
- name: url lookup using headers
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ lookup('ansible.builtin.url', 'https://some.private.site.com/api/service', headers={'header1':'value1', 'header2':'value2'} ) }}"
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue