Skip to content

file_info

Markus Bergholz edited this page Jul 23, 2021 · 1 revision

markuman.nextcloud.file_info

Point it to file or folder.

- name: file info folder
  markuman.nextcloud.file_info:
    source: Photos
  register: out_state

Output looks like this.

ok: [localhost] => {
    "out_state": {
        "changed": false,
        "failed": false,
        "file_info": {
            "content_type": "inode/directory",
            "favorite": "0",
            "file_id": "17",
            "href": "/remote.php/dav/files/ansible/Photos/",
            "last_modified": "Fri, 23 Jul 2021 10:20:19 GMT",
            "owner": "ansible",
            "size": "5656463",
            "source": "Photos"
        }
    }
}

And if file or folder does not exist.

ok: [localhost] => {
    "out": {
        "changed": false,
        "failed": false,
        "file_info": {
            "source": {}
        }
    }
}

Clone this wiki locally