file
!file
Category: files
Manage the state of a regular file on the target — create/touch, remove, or adjust attributes (owner/group/mode). Fails if the path is a directory.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
path | path | yes | Absolute path of the file to manage. |
remove | bool | no | Remove the file if it exists. |
attributes | map | no | File attributes: owner, group, mode (octal, requires 0o or 0 prefix). |
Examples
- !file
path: /var/lib/app/installed
attributes:
owner: app
mode: '0o644'