Skip to content
ohtools@docs:/declarative/file
verified/seq 4
view /declarative/file

File

Modules / file

Manage file content from a sealed asset or restricted template.

mutatingfiles8 fields

YAML example

- name: Install configuration
  file:
    path: /etc/example/app.conf
    state: present
    asset: assets/app.conf
    mode: "0644"
    notify: [restart-example]

Schema fields

FieldTypeRequiredConstraint
pathstringyesAbsolute managed path.
statestringyesDesired file state.
present | absent
assetstringPath to a sealed project asset.
templatestringRestricted scalar template source.
ownerstringRequired owner name.
groupstringRequired group name.
modestringFour-digit octal mode.
notifyarrayHandler names notified after a verified change.