Within Ansible Automation Platform, getting '/path/to/directory' does not exist, when it does indeed

19 views
Skip to first unread message

Tim

unread,
Dec 6, 2022, 12:25:35 AM12/6/22
to Ansible Development
Hi Guys,

I have a playbook that gets all of the files within a directory:
```
- name: Find Backup Files to Move 
 find: paths: /path/to/directory 
 recurse: no 
 excludes: 'test-file.tar.gz' 
 delegate_to: localhost 
 register: testfiles
```
This playbook keeps failing with the following message:
```
[WARNING]: Skipped '/path/to/directory' path due to this access issue:
6
'/path/to/directory' is not a directory
```
The directory certainly does exist, and it is not empty:
```
-rwxr-x---. 1 awx awx 98358 Dec  6 00:00 test-file-2022-backup-12-06-00:00:06.tar.gz
lrwxrwxrwx. 1 awx awx    80 Dec  6 00:00 test-file-latest.tar.gz -> /path/to/directory/test-file-backup-2022-12-06-00:00:06.tar.gz

```
What can I do to troubleshoot this further?

Todd Lewis

unread,
Dec 6, 2022, 12:37:48 PM12/6/22
to Ansible Development
My guess is that you are mistaken, either in the path or the host this task is executing on.
In the mean time, what's the difference between expected and actual output from the following task:
```
- name: Where is my missing path
  shell: |
    echo "Give me some clues:"
    echo "Hostname: $(hostname)"
    ls -ld /path
    ls -ld /path/to
    ls -ld /path/to/directory
 ```

Todd Lewis

unread,
Dec 6, 2022, 12:42:23 PM12/6/22
to Ansible Development
Also, this conversation should be happening in
rather than
Reply all
Reply to author
Forward
0 new messages