# copy local or fetch with content

**URL:** <https://forum.ansible.com/t/copy-local-or-fetch-with-content/17175>\
**Category:** Ansible Project\
**Created:** [January 3, 2015, 5:34pm UTC](https://forum.ansible.com/t/copy-local-or-fetch-with-content/17175 "2015-01-03T17:34:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akos\_Vandra](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Akos\_Vandra](https://forum.ansible.com/u/Akos_Vandra)\
**Post date:** [January 3, 2015, 5:34pm UTC](https://forum.ansible.com/t/copy-local-or-fetch-with-content/17175/1 "2015-01-03T17:34:13Z")

</div>

Hello!

Are there any plans to support the content parameter in fetch similar to how it’s done in copy? Would you accept a PR for it?  
I need to set the contents of a local file in the playbook directory.

Using copy with delegation to localhost does not work unless I hardcode the location of the playbook, which is not something i want to do.

Currently I am working around the issue like this:

- name: Generate config file  
hosts: 127.0.0.1  
connection: local  
tasks:
- custom\_module  
register: dow
- copy:  
dest=“dow.config  
content=”{{ dow.config }}"
- fetch:  
src: /tmp/dow.config  
dest: dow.config  
flat: yes

Thanks,  
Akos
