ansible playbook ssh-keygen

is there a module to run ssh-keygen on remote hosts?

any exmaples

Yes. Module *user* is able to generate a SSH key. See
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html#parameter-generate_ssh_key

how about copying public key from another host to authorized_keys on the server? is there a module? or need ad hoc command

https://docs.ansible.com/ansible/latest/collections/ansible/posix/authorized_key_module.html

I guess user is trying copy authorized key from host A to host B if i didnt mis understood.

If so, use synchronize module with delegate_to parameter at task level