copy local or fetch with content

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