patch
Collection: posix
Full Name: parallax.posix.patch
Aliases: ansible.posix.patch, patch
Synopsis
Apply a unified diff to files on the target
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| src | string | yes | Path to the patch file to apply | |
| dest | string | Path of the file on the remote host to patch | ||
| basedir | string | Path of a base directory the patch is applied in (defaults to dest’s directory) | ||
| strip | string | 0 | Number of leading path components to strip from file names | |
| remote_src | bool | true | The patch file already exists on the target (parallax only supports true) | |
| backup | bool | false | Create a backup of the original file(s) | |
| binary | bool | false | Pass –binary to patch, which reads and writes data in binary mode | |
| state | string | present | Whether the patch should be applied (present) or reverted (absent) |
Example
- name: Apply a vendor patch to the config
patch:
src: files/fix-timeout.patch
basedir: /opt/vendor
strip: 1
backup: true
state: present