Available module lineinfile - Concatenate quotes and double quotes
I'm trying to add a string containing single quotes and double quotes and I can't seem to do it for an expired hour ...
vars:
line1: "a=\\\"a'b'c\\\""
line2: 'a="a\''b\''c"'
tasks:
- name: lineinfile test
lineinfile: dest=/tmp/tmp line={{item}}
with_items:
- "{{line1}}"
- "{{line2}}"
search string a="a'b'c"
content / tmp / tmp
a="abc"
a=a'b'c
so that's the trick. ideas?
+3
user1692261
source
to share
1 answer
line2: a=\\\"a\\\'b\\\'c\\\"
Anyone who can improve the answer with an explanation is more than welcome.
+2
Dusan Bajic
source
to share