# problem copy/template module with edgerouter

**URL:** <https://forum.ansible.com/t/problem-copy-template-module-with-edgerouter/30968>\
**Category:** Ansible Project\
**Created:** [August 7, 2019, 3:47am UTC](https://forum.ansible.com/t/problem-copy-template-module-with-edgerouter/30968 "2019-08-07T03:47:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cch](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@cch](https://forum.ansible.com/u/cch)\
**Post date:** [August 7, 2019, 3:47am UTC](https://forum.ansible.com/t/problem-copy-template-module-with-edgerouter/30968/1 "2019-08-07T03:47:28Z")

</div>

I want to configure some of edgerouters with ansible  
one of the tasks is send a user`s public key then config authenticate with that key  
the task is quite simple  
but I found although the tasks runs successfully , but the file does not show on edgerouter

> - name: “Copy SSH public key to router”  
> copy:  
> src: “usera.pub”  
> dest: “/tmp/usera.pub”

and also I try to generate file by using templates , the same situation, tasks runs ok , but destination file does not exists.

ans here is the playbook

> - hosts: all  
> become: True  
> become\_user: root  
> become\_method: sudo  
> connection: network\_cli  
> gather\_facts: no  
> vars:
> - role\_users: “{{ technical\_users }}”
> - server\_location: hq
> - ansible\_network\_os: edgeos
> - ansible\_connection: network\_cli
> - ansible\_become: yes
> - ansible\_become\_method: enable
> 
> roles:
> 
> - { role: hosts, tags: hosts }
> - { role: edgerouter , tags: edgerouter }

any suggestions ?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 7, 2019, 6:03pm UTC](https://forum.ansible.com/t/problem-copy-template-module-with-edgerouter/30968/2 "2019-08-07T18:03:09Z")

</div>

I don't know anything about edgerouters (if that is a brand) but most routers and switches don't have Python so modules using Python will not work and that includes copy and template module.  
Most routers switches do have there own modules that utilize the network\_cli connection plugin.  
[https://docs.ansible.com/ansible/latest/modules/list\_of\_network\_modules.html](https://docs.ansible.com/ansible/latest/modules/list_of_network_modules.html)

So if it not on the list you are most likely left with the expect module to interact with the router.

---

<div class="post-metadata">

**Author:** ![ganeshrn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ganeshrn/32/1021_2.png) [@ganeshrn](https://forum.ansible.com/u/ganeshrn)\
**Post date:** [August 8, 2019, 5:16am UTC](https://forum.ansible.com/t/problem-copy-template-module-with-edgerouter/30968/3 "2019-08-08T05:16:24Z")

</div>

You can try with net\_put module[https://docs.ansible.com/ansible/latest/modules/net\_put\_module.html](https://docs.ansible.com/ansible/latest/modules/net_put_module.html)
