--- # This playbook cleans up its own backup directory. - name: Cleanup semaphore hosts: all gather_facts: true tasks: - include_vars: vars/semaphore/variable.yaml - name: Search for backup directories become: yes find: paths: "{{ local_backup }}" file_type: directory recurse: false register: backup_dirs - name: Copy backup files debug: var=item loop: "{{ backup_dirs.files.path }}"