How to get the device name of a specified mount point with ansible facts?
Use json_query. For example
    - set_fact:
        my_device: &quot;{{ ansible_mounts|json_query(query) }}&quot;
      vars:
        query: &quot;[?mount=='/'].device &quot;
    - debug:
        var: my_device

gives
    my_device:
      - /dev/sdc1

To get the first element of the list only append the filter first
    - set_fact:
        my_device: &quot;{{ ansible_mounts|json_query(query)|first }}&quot;