path-has-mode

Example:

# Set the mode of an existing file.
- path-has-mode:
    path: /tmp/freckles.sh
    mode: '0775'

Description

Make sure a file/folder has a certain owner/group.

This will recursively apply the mode change in case the path is a directory. If the path does not exist, nothing will be done.

Root/sudo permissions will be used to do the chmod.

Variables

Name Type Default Description

mode

string --

The mode to apply. Required

path

string --

the path Required

recursive

boolean False

Whether to apply the changes recursively (if folder).

Examples

Example 1

Set the mode of an existing file.

Code
- path-has-mode:
    path: /tmp/freckles.sh
    mode: '0775'

Command-line

frecklecute path-has-mode --help

Usage: frecklecute path-has-mode [OPTIONS]

  Make sure a file/folder has a certain owner/group.

  This will recursively apply the mode change in case the path is a
  directory. If the path does not exist, nothing will be done.

  Root/sudo permissions will be used to do the chmod.

Options:
  --mode MODE                   The mode to apply.  [required]
  --path PATH                   the path  [required]
  --recursive / --no-recursive  Whether to apply the changes recursively (if
                                folder).
  --help                        Show this message and exit.