init
This commit is contained in:
commit
c5cd492449
475 changed files with 27928 additions and 0 deletions
22
technology/tools/Ansible/lookups/ansible.builtin.file.md
Normal file
22
technology/tools/Ansible/lookups/ansible.builtin.file.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
# ansible.builtin.file
|
||||
This lookup returns the contents from a file on the Ansible controller’s file system.
|
||||
|
||||
## Parameters
|
||||
| Parameter | Type | Description |
|
||||
| ---------- | ----------------- | ---------------------------------------------------------------------------- |
|
||||
| **Input** | string / required | path(s) of files to read |
|
||||
| **lstrip** | boolean | whether or not to remove whitespace from the beginning of the looked-up file |
|
||||
| **rstrip** | boolean | whether or not to remove whitespace from the ending of the looked-up file |
|
||||
|
||||
## Examples
|
||||
```yml
|
||||
- ansible.builtin.debug:
|
||||
msg: "the value of foo.txt is {{ lookup('ansible.builtin.file', '/etc/foo.txt') }}"
|
||||
|
||||
- name: display multiple file contents
|
||||
ansible.builtin.debug: var=item
|
||||
with_file:
|
||||
- "/path/to/foo.txt"
|
||||
- "bar.txt" # will be looked in files/ dir relative to play or in role
|
||||
- "/path/to/biz.txt"
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue