Newline in copy module, content parameter

1,295 views
Skip to first unread message

Tin Tvrtković

unread,
Mar 18, 2013, 6:30:03 AM3/18/13
to ansible...@googlegroups.com
Hi,

just a quick question regarding the copy module, content parameter. Is there a way of making this operation output a line separator in the destination file? For example,

copy: dest=/etc/blabla content="VAR=var\nVAR2=var2"

(this puts a literal \n into the file). Currently I use the shell module for this (to avoid including a template for such a simple thing), but the copy module is prettier.

Cheers

P.S. The documentation for the content parameters mentions it was added in 1.1 twice (When used instead of 'src', sets the contents of a file directly to the specified value. (New in 1.1). (added in Ansible 1.1)).

Michael DeHaan

unread,
Mar 18, 2013, 7:36:54 AM3/18/13
to ansible...@googlegroups.com
Consider using an actual src file.

The 'content' parameter was a recent addition and you do not need to use this.
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Michael DeHaan <mic...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

Tin Tvrtković

unread,
Mar 18, 2013, 8:12:13 AM3/18/13
to ansible...@googlegroups.com
Roger, thanks.
Reply all
Reply to author
Forward
0 new messages