summaryrefslogtreecommitdiff
path: root/files/replace.py
diff options
context:
space:
mode:
Diffstat (limited to 'files/replace.py')
-rw-r--r--files/replace.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/files/replace.py b/files/replace.py
index ef66c223..d4e3ab9f 100644
--- a/files/replace.py
+++ b/files/replace.py
@@ -77,11 +77,24 @@ options:
"""
EXAMPLES = r"""
-- 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=/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/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: 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):