Is it possible to use templates as a source when using the patch module?

Hi,

I’m wondering whether it’s possible to use a Jinja2 template as a source in a patch task.
(Documentation of the module: http://docs.ansible.com/ansible/patch_module.html)

An example:

  • name: Copy patch template to remote system
    template:
    src: mypatch.patch.j2
    dest: /tmp/mypatch.patch

  • name: Apply patch
    patch:
    src: /tmp/mypatch.patch
    dest: /some/destination/to/patch
    remote_src: yes

I would like to replace this with:

  • name: Apply patch
    patch:
    src: mypatch.patch.j2
    dest: /some/destination/to/patch

Is this possible? If yes, what is right way to do this?
Is there someone who can help me?

Thank you!

Best regards,

Christopher

No, but you can use the template module to generate the patch file before running the patch module.