我想在安装过程中更改文件/var/www/kibana/config.js中的一行代码
elasticsearch: "http://"+window.location.hostname+":9200"
至
elasticsearch: "http://192.168.1.200:9200"
在这里我试图使用lineinfile做如下所示
- name: Comment out elasticsearch the config.js to ElasticSearch server lineinfile: dest=/var/www/kibana/config.js backrefs=true regexp="(elasticsearch.* \"http.*)$" line="elasticsearch\: \" {{ elasticsearch_URL }}:{{ elasticsearch_port }} \" " state=present
我已将{{elasticsearch_URL}}和{{elasticsearch_port}}的变量分别设置为http://192.168.1.200和9200。
这是我遇到的错误信息:
ERROR: Syntax Error while loading YAML script,/Users/shuoy/devops_workspace/ansible_work/logging-for-openstack/roles/kibana/tasks/Debian.yml Note: The error may actually appear before this position: line 29,column 25 regexp="(elasticsearch.* \"http.*)$" line="elasticsearch\: \" {{ elasticsearch_URL }}:{{ elasticsearch_port }} \" " ^