back

attrs

Ensure a file or directory has the specified ownership and modification parameters

Overview

  • This module ensures that a path has the specified ownership and modification flags.

Form

(attrs options)

Arguments

options

A hashmap of options

Options

OptionDescription
:path
type string

    The location of the file or directory to operate on

:owner
type integerstring

    The user that should have ownership over the file or directory. Can be specified as the username or the user id.

:group
type integerstring

    The group that should have ownership over the file or directory. Can be specified as the groupname or the group id.

:mode
type integerstring

    Set the access mode of this file or files.

    Can be specified as an octal value of the form 0xxx, as a decimal value, or as a change string as is accepted by the system chmod command (eg. "u+rwx").

:dir-mode
type integerstring

    Set the access mode of any directory or directories.

    User when settings attributes recursively.

    Can be specified as an octal value of the form 0xxx, as a decimal value, or as a change string as is accepted by the system chmod command (eg. "u+rwx").

:recurse
type boolean

    Recurse into subdirectories and set the attributes of all files and directories therein.

Examples

Make a directory to store a website in on nginx

(attrs {:path "/var/www/mysite.mydomain"
        :owner "www-data"
        :group "www-data"})