# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1459446990 -28800
# Node ID a2442a06678e8beea76bd2beb5b2a1e007f344b0
# Parent  802e874c8c26c710eee1fe350419a60ed8e573ee
pre_tasks: use lineinfile instead of echo with shell

diff -r 802e874c8c26 -r a2442a06678e playbook-example.yml
--- a/playbook-example.yml	Fri Apr 01 01:55:45 2016 +0800
+++ b/playbook-example.yml	Fri Apr 01 01:56:30 2016 +0800
@@ -11,7 +11,7 @@
     - name: Set hostname
       hostname: name={{ hostname }}
     - name: Update /etc/hosts
-      shell: echo '127.0.0.1 {{ hostname }}' >> /etc/hosts
+      lineinfile: dest=/etc/hosts line="127.0.0.1 {{ hostname }} hg.{{ hostname }}"
 
     # NOTE: this role depends on nginx and supervisor packages being installed,
     # and also it uses two handlers: