rcx_one.linkoverlay.clean (0.1.0) — module

clears a path while keeping files contained in a journal

| "added in version" 0.1.0 of rcx_one.linkoverlay"

Authors: Eike (@E1k3)

Install collection

Install with ansible-galaxy collection install rcx_one.linkoverlay:==0.1.0


Add to requirements.yml

  collections:
    - name: rcx_one.linkoverlay
      version: 0.1.0

Description

Removes all paths in a directory except those contained in an exclude list. Meant to be used with the journal callback or journal role to make sure a directory does not contain anything that was not created by ansible. Because of this, lines beginning with '!' are interpreted as errors messages.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove old synced files
  rcx_one.linkoverlay.clean:
    path: "/home/user/dotfiles"
    exclude:
      - "/home/user/dotfiles/keep_me"

Inputs

    
path:
    description: The path to be cleaned.
    required: true
    type: path

exclude:
    default: []
    description: The lines of the journal of files to keep.
    elements: str
    required: false
    type: list

Outputs

removed:
  description: Removed paths
  returned: changed
  sample:
  - /home/user/old_file
  type: list