From d3e7d4f4695d0a32bd9453838823dff0e935f841 Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Wed, 12 Oct 2016 17:36:22 -0400 Subject: [PATCH] Change example syntax on replace module --- lib/ansible/modules/files/replace.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/files/replace.py b/lib/ansible/modules/files/replace.py index 86b4d4d8fdc..c0271018842 100644 --- a/lib/ansible/modules/files/replace.py +++ b/lib/ansible/modules/files/replace.py @@ -76,11 +76,24 @@ options: """ EXAMPLES = r""" -- replace: dest=/etc/hosts regexp='(\s+)old\.host\.name(\s+.*)?$' replace='\1new.host.name\2' backup=yes +- replace: + dest: /etc/hosts + regexp: '(\s+)old\.host\.name(\s+.*)?$' + replace: '\1new.host.name\2' + backup: yes -- replace: dest=/home/jdoe/.ssh/known_hosts regexp='^old\.host\.name[^\n]*\n' owner=jdoe group=jdoe mode=644 +- replace: + dest: /home/jdoe/.ssh/known_hosts + regexp: '^old\.host\.name[^\n]*\n' + owner: jdoe + group: jdoe + mode: 0644 -- replace: dest=/etc/apache/ports regexp='^(NameVirtualHost|Listen)\s+80\s*$' replace='\1 127.0.0.1:8080' validate='/usr/sbin/apache2ctl -f %s -t' +- replace: + dest: /etc/apache/ports + regexp: '^(NameVirtualHost|Listen)\s+80\s*$' + replace: '\1 127.0.0.1:8080' + validate: '/usr/sbin/apache2ctl -f %s -t' """ def write_changes(module,contents,dest):