diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fe01dad26..3d217502b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ Ansible Changes By Release Use ignore_errors or failed_when in playbooks if you wish to ignore errors. * Experimentally added pmrun become method. * Enable the docker connection plugin to use su as a become method +* Add an encoding parameter for the replace module so that it can operate on non-utf-8 files #### New Inventory scripts: - lxd diff --git a/lib/ansible/modules/files/replace.py b/lib/ansible/modules/files/replace.py index 141b753b84..cf03f5452d 100644 --- a/lib/ansible/modules/files/replace.py +++ b/lib/ansible/modules/files/replace.py @@ -96,6 +96,12 @@ options: version_added: "1.9" description: - 'This flag indicates that filesystem links, if they exist, should be followed.' + encoding: + required: false + default: "utf-8" + version_added: "2.4" + description: + - "The character encoding for reading and writing the file." notes: - As of Ansible 2.3, the I(dest) option has been changed to I(path) as default, but I(dest) still works as well. """