path-is-absent

Example:

# Delete a file (if it exists), using root privileges.
- path-is-absent:
    path: /usr/bin/freckles.sh
    become: true

Description

Ensure a file or folder is absent. If the path is a folder, it will be deleted recursively.

Variables

Name Type Default Description

path

string --

The path. Required

become

boolean False

Whether to use elevated privileges when deleting a file/tree.

Examples

Example 1

Delete a file (if it exists), using root privileges.

Code
- path-is-absent:
    path: /usr/bin/freckles.sh
    become: true

Example 2

Delete a file (if it exists).

Code
- path-is-absent:
    path: /tmp/freckles.sh

Command-line

frecklecute path-is-absent --help

Usage: frecklecute path-is-absent [OPTIONS] PATH

  Ensure a file or folder is absent. If the path is a folder, it will be
  deleted recursively.

Options:
  --become / --no-become  Whether to use elevated privileges when deleting a
                          file/tree.
  --help                  Show this message and exit.