When I use lineinfile
in ansible it is not writing '
, "
characters
lineinfile: 'dest=/home/xyz state=present line="CACHES="default""'
it is giving CACHES=default
but the desired output is CACHES="default"
How to achieve this?
ansibleansible-playbook
When I use lineinfile
in ansible it is not writing '
, "
characters
lineinfile: 'dest=/home/xyz state=present line="CACHES="default""'
it is giving CACHES=default
but the desired output is CACHES="default"
How to achieve this?
Best Answer
it appears you can escape the quotes:
That gives this output:
You don't need to escape single quotes that are inside double quotes:
source: YAML specification, stackoverflow answer