# Error when copy config to a file

**URL:** <https://forum.ansible.com/t/error-when-copy-config-to-a-file/27901>\
**Category:** Ansible Project\
**Created:** [June 28, 2018, 7:03pm UTC](https://forum.ansible.com/t/error-when-copy-config-to-a-file/27901 "2018-06-28T19:03:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Aljawad](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@Ahmed\_Aljawad](https://forum.ansible.com/u/Ahmed_Aljawad)\
**Post date:** [June 28, 2018, 7:03pm UTC](https://forum.ansible.com/t/error-when-copy-config-to-a-file/27901/1 "2018-06-28T19:03:39Z")

</div>

#### Error Below

TASK [copy-to-folder] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [ASCMN01]: FAILED! =\> {“msg”: “The task includes an option with an undefined variable. The error was: ‘dict object’ has no attribute ‘backup\_path’\n\nThe error appears to have been in ‘/home/nwadmin/Back2.yml’: line 14, column 8, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name : copy-to-folder\n ^ here\n”}  
fatal: [ASCMN02]: FAILED! =\> {“msg”: “The task includes an option with an undefined variable. The error was: ‘dict object’ has no attribute ‘backup\_path’\n\nThe error appears to have been in ‘/home/nwadmin/Back2.yml’: line 14, column 8, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name : copy-to-folder\n ^ here\n”}  
to retry, use: --limit @/home/nwadmin/Back2.retry

### My playbook

---

<div class="post-metadata">

**Author:** ![gundalow](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gundalow/32/99_2.png) [@gundalow](https://forum.ansible.com/u/gundalow)\
**Post date:** [June 28, 2018, 8:02pm UTC](https://forum.ansible.com/t/error-when-copy-config-to-a-file/27901/2 "2018-06-28T20:02:09Z")

</div>

Hi,  
1) It's ios\_config which does the backup when run with `backup: yes`, see the module documentation for ios\_config at [cisco.ios.ios\_config module – Module to manage configuration sections. — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/modules/ios_config_module.html)

2)  
I'd also suggest reading through [Ansible for Network Automation — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/network)
