--- - hosts: all become: true tasks: # write hello world to a file in the home directory - name: write hello copy: content: "hello ansible!" dest: /home/vagrant/hello.txt mode: 0644 become: true - name: Echo hello shell: echo 'hello ansible!' args: chdir: $HOME