From 6e473a432b22d36bd0cc219ea1092eb8755c8da1 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 5 Jun 2017 19:37:53 -0700 Subject: [PATCH] Document the encoding parameter for the replace module Add encoding parameter for replace to changelog --- CHANGELOG.md | 1 + lib/ansible/modules/files/replace.py | 6 ++++++ 2 files changed, 7 insertions(+) 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. """