Hi All,

I am using Line in file nodule to write a list output in ansible to a file in 
the target machine.

Below is the code i have used.

hosts: localhost
tasks:
  - lineinfile:
      create: yes
      regexp: "NONEXISTENTLINE"
      dest: /projects/testing/check.txt
      line : "{{item}}"
      state: present
    with_items:
    - "{{something}}"

And that something is a list and its value is given below,

["WOAprofile1",
"WOAprofile2",
"WOAprofile3"]

When I am using the above line in file prints each value of the list in 
separate line.
But I need the output in the file as below,
WOAprofile1, WOAprofile2, WOAprofile3

Note: the number of lines in the variable "something" will be differ from 
server to server.
 


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ca1770f8-21e8-4ffc-911c-2d595b43ee56%40googlegroups.com.

Reply via email to