added version to patch and remote_src to allow for controlling if src is on master or target

This commit is contained in:
Brian Coca 2015-02-09 16:27:03 -05:00 committed by Matt Clay
parent 8383c1c8d3
commit 60459795b0

View file

@ -23,7 +23,9 @@ DOCUMENTATION = '''
--- ---
module: patch module: patch
author: Luis Alberto Perez Lazaro, Jakub Jirutka 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. short_description: Apply patch files using the GNU patch tool.
options: options:
basedir: basedir:
@ -41,10 +43,16 @@ options:
aliases: [ "originalfile" ] aliases: [ "originalfile" ]
src: src:
description: description:
- Path of the patch file on the remote machine as accepted by the GNU - Path of the patch file as accepted by the GNU patch tool.
patch tool.
required: true required: true
aliases: [ "patchfile" ] 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: strip:
description: description:
- Number that indicates the smallest prefix containing leading slashes - Number that indicates the smallest prefix containing leading slashes
@ -110,7 +118,8 @@ def main():
'src': {'required': True, 'aliases': ['patchfile']}, 'src': {'required': True, 'aliases': ['patchfile']},
'dest': {'aliases': ['originalfile']}, 'dest': {'aliases': ['originalfile']},
'basedir': {}, 'basedir': {},
'strip': {'default': 0, 'type': 'int'} 'strip': {'default': 0, 'type': 'int'},
'remote_src': {'default': False, 'type': 'bool'},
}, },
required_one_of=[['dest', 'basedir']], required_one_of=[['dest', 'basedir']],
supports_check_mode=True supports_check_mode=True