Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
shell cat <<EOF command adding space in front of every line #39137
Ansible Module: shell
ansible 2.5.1 config file = /etc/ansible/ansible.cfg configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/dist-packages/ansible executable location = /usr/bin/ansible python version = 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
OS / ENVIRONMENT
I've changed the shell module to use
And using the multiline command. However, the resulting file has a space in front of every line?
@naisanza You can use
--- - name: Test shell hosts: localhost gather_facts: no tasks: - name: Execute cat shell: cmd: | cat > /tmp/a.txt << EOF This is a EOF echo "this is new line" >> /tmp/a.txt args: executable: /bin/zsh
Thanks very much for your interest in Ansible. It sincerely means a lot to us.
This appears to be a user question, and we'd like to direct these kinds of things to either the mailing list or the IRC channel.
If you can stop by there, we'd appreciate it. This allows us to keep the issue tracker for bugs, pull requests, RFEs and the like.
Thank you once again and we look forward to seeing you on the list or IRC. Thanks!