view /declarative/file
File
Modules / file
Manage file content from a sealed asset or restricted template.
YAML example
- name: Install configuration
file:
path: /etc/example/app.conf
state: present
asset: assets/app.conf
mode: "0644"
notify: [restart-example]Schema fields
| Field | Type | Required | Constraint |
|---|---|---|---|
path | string | yes | Absolute managed path. |
state | string | yes | Desired file state.present | absent |
asset | string | — | Path to a sealed project asset. |
template | string | — | Restricted scalar template source. |
owner | string | — | Required owner name. |
group | string | — | Required group name. |
mode | string | — | Four-digit octal mode. |
notify | array | — | Handler names notified after a verified change. |