I want to change one line of my code in file /var/www/kibana/config.js during installation from
elasticsearch: \"http://\"+window.location.hostname+\":9200\"
you need to enclose the entire line in ", where : appears.
"
:
lineinfile: 'dest=/var/www/kibana/config.js backrefs=true regexp="(elasticsearch.* \"http.*)$" line="elasticsearch\: \ {{ elasticsearch_URL }}:{{ elasticsearch_port }} \ " state=present'
See these pages: Link-1 Link-2 Link-3