Change example syntax on replace module

pull/18777/head
Sam Doran 8 years ago committed by Matt Clay
parent 25f6f36a92
commit d3e7d4f469

@ -76,11 +76,24 @@ options:
""" """
EXAMPLES = r""" EXAMPLES = r"""
- replace: dest=/etc/hosts regexp='(\s+)old\.host\.name(\s+.*)?$' replace='\1new.host.name\2' backup=yes - replace:
dest: /etc/hosts
- replace: dest=/home/jdoe/.ssh/known_hosts regexp='^old\.host\.name[^\n]*\n' owner=jdoe group=jdoe mode=644 regexp: '(\s+)old\.host\.name(\s+.*)?$'
replace: '\1new.host.name\2'
- 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' backup: yes
- 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'
""" """
def write_changes(module,contents,dest): def write_changes(module,contents,dest):

Loading…
Cancel
Save