From 60459795b093950eead7824afdca93cc2a01fe20 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 9 Feb 2015 16:27:03 -0500 Subject: [PATCH] added version to patch and remote_src to allow for controlling if src is on master or target --- lib/ansible/modules/extras/files/patch.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/extras/files/patch.py b/lib/ansible/modules/extras/files/patch.py index e2e5467f36e..46fefe86dd2 100644 --- a/lib/ansible/modules/extras/files/patch.py +++ b/lib/ansible/modules/extras/files/patch.py @@ -23,7 +23,9 @@ DOCUMENTATION = ''' --- module: patch author: Luis Alberto Perez Lazaro, Jakub Jirutka -version_added: 1.8 +version_added: 1.9 +description: + - Apply patch files using the GNU patch tool. short_description: Apply patch files using the GNU patch tool. options: basedir: @@ -41,10 +43,16 @@ options: aliases: [ "originalfile" ] src: description: - - Path of the patch file on the remote machine as accepted by the GNU - patch tool. + - Path of the patch file as accepted by the GNU patch tool. required: true aliases: [ "patchfile" ] + remote_src: + description: + - If False, it will search for src at originating/master machine, if True it will + go to the remote/target machine for the src. Default is False. + choices: [ "True", "False" ] + required: false + default: "False" strip: description: - Number that indicates the smallest prefix containing leading slashes @@ -110,7 +118,8 @@ def main(): 'src': {'required': True, 'aliases': ['patchfile']}, 'dest': {'aliases': ['originalfile']}, 'basedir': {}, - 'strip': {'default': 0, 'type': 'int'} + 'strip': {'default': 0, 'type': 'int'}, + 'remote_src': {'default': False, 'type': 'bool'}, }, required_one_of=[['dest', 'basedir']], supports_check_mode=True