# Question about authorized\_key module

**URL:** <https://forum.ansible.com/t/question-about-authorized-key-module/37441>\
**Category:** Ansible Project\
**Created:** [December 7, 2022, 8:23pm UTC](https://forum.ansible.com/t/question-about-authorized-key-module/37441 "2022-12-07T20:23:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harry\_devine](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/harry_devine/32/5293_2.png) [@harry\_devine](https://forum.ansible.com/u/harry_devine)\
**Post date:** [December 7, 2022, 8:23pm UTC](https://forum.ansible.com/t/question-about-authorized-key-module/37441/1 "2022-12-07T20:23:59Z")

</div>

Can someone clear this up for me? If I have the following playbook:

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [December 7, 2022, 9:18pm UTC](https://forum.ansible.com/t/question-about-authorized-key-module/37441/2 "2022-12-07T21:18:33Z")

</div>

No. The playbook won't neither do \*ssh-copy-id\* nor will it copy  
public keys from each host in rhev\_hosts to every other host in that  
host group. The playbook will read /root/.ssh/id\_rsa.pub on the  
controller and insert this public key into the root's authorized\_key  
file on each host in the group rhev\_hosts.

Notes:  
\* lookup always works on the controller.  
\* It is a bad idea to use root account on the Ansible controller to  
&nbsp;&nbsp;run a playbook.  
\* It is also a bad idea to ssh to root on the remote host.  
\* The module ansible.posix.authorized\_key doesn't use \*ssh-copy-id\*  
&nbsp;&nbsp;utility. It writes the file authorized\_key directly.
