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

8 views
Skip to first unread message

chrstp...@gmail.com

unread,
Jan 25, 2017, 11:56:22 AM1/25/17
to Ansible Project
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

Brian Coca

unread,
Jan 25, 2017, 12:16:14 PM1/25/17
to ansible...@googlegroups.com
No, but you can use the template module to generate the patch file before running the patch module.


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages