# Tasks export keys

**URL:** <https://forum.ansible.com/t/tasks-export-keys/41310>\
**Category:** Get Help\
**Created:** [March 25, 2025, 4:45pm UTC](https://forum.ansible.com/t/tasks-export-keys/41310 "2025-03-25T16:45:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeferson\_nascimento](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jeferson_nascimento/32/5589_2.png) [@jeferson\_nascimento](https://forum.ansible.com/u/jeferson_nascimento)\
**Post date:** [March 25, 2025, 4:45pm UTC](https://forum.ansible.com/t/tasks-export-keys/41310/1 "2025-03-25T16:45:33Z")

</div>

Good afternoon everyone, I have a problem because I couldn’t find a similar task to validate mine. I want to export the public key to some machines. I appreciate your attention and help if anyone has already done or gone through the same thing. Below is an example of what I’m trying. Thank you.

* * *

- name: Ansible Checksum, Backup, Validate  
hosts: hosts01  
tasks:  
#Checksum
  - name: Deploy WAR file to Tomcat  
copy:  
src: ~/home/vagrant/.ssh/id\_rsa.pub  
dest: /home/root/.ssh  
checksum: “{{ lookup(‘file’, ‘~/home/vagrant/.ssh/id\_rsa.pub’) | hash(‘sha256’) }}”  
become: true

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [March 25, 2025, 8:37pm UTC](https://forum.ansible.com/t/tasks-export-keys/41310/2 "2025-03-25T20:37:12Z")

</div>

Have you checked the authorized\_keys module?

> **[ansible.posix.authorized\_key module – Adds or removes an SSH authorized key —...](https://docs.ansible.com/ansible/latest/collections/ansible/posix/authorized_key_module.html)**
