community.openwrt.tempfile module – Creates temporary files and directories on OpenWrt nodes
Note
This module is part of the community.openwrt collection (version 1.1.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.openwrt.
To use it in a playbook, specify: community.openwrt.tempfile.
New in community.openwrt 1.1.0
Synopsis
The community.openwrt.tempfile module creates temporary files and directories on the OpenWrt target.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
|---|---|
Location where the temporary file or directory should be created. Default: |
|
Prefix of the file or directory name. Default: |
|
Whether to create a file or a directory. Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Can run in |
|
Support: none |
Returns details on what has changed (or possibly needs changing in |
|
Platform: OpenWrt |
Target platform for this module. |
Notes
Note
This module always returns
changed=truebecause it creates a new temporary file or directory each time it runs.
Examples
- name: Create temporary file
community.openwrt.tempfile:
state: file
register: temp_file_1
- name: Create temporary directory with `build` prefix
community.openwrt.tempfile:
state: directory
prefix: build
register: temp_dir_1
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The absolute path to the created file or directory. Returned: success Sample: |