Skip to content

directory

!directory

Category: files

Manage a directory on the target — create, remove, or adjust attributes. Fails if the path is an existing regular file.

Parameters

NameTypeRequiredDescription
pathpathyesAbsolute path of the directory to manage.
removeboolnoRemove the directory if it exists.
recurseboolnoApply attribute changes recursively into the directory contents.
attributesmapnoFile attributes: owner, group, mode.

Examples

- !directory
  path: /srv/app/data
  recurse: true
  attributes:
    owner: app
    mode: '0o755'