copy local or fetch with content

7 views
Skip to first unread message

Akos Vandra

unread,
Jan 3, 2015, 12:34:16 PM1/3/15
to ansible-project
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
Reply all
Reply to author
Forward
0 new messages