I would use the dedicated find task. Apply a depth filter just in case.
Something like this should do the trick:
- name: known hosts script play
hosts: all
become: true
gather_facts: false
tasks:
- name: Find known hosts
ansible.builtin.find:
paths:
- /root
- /home
patterns: known_hosts
recurse: true
depth: 3
register: found
- name: Change known_host file
ansible.builtin.script:
cmd: foo.sh "{{ item }}"
loop: "{{ found.files|map(attribute='path') }}"
foo.sh is a script on your controller, adjacent to your playbook.