Change example syntax on replace module
This commit is contained in:
parent
25f6f36a92
commit
d3e7d4f469
1 changed files with 16 additions and 3 deletions
|
@ -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
|
||||||
|
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):
|
def write_changes(module,contents,dest):
|
||||||
|
|
Loading…
Reference in a new issue