How can escape colon in a string within an Ansible YAML file?

前端 未结 5 1903
無奈伤痛
無奈伤痛 2020-12-03 06:47

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\"         


        
5条回答
  •  情歌与酒
    2020-12-03 07:35

    It’s a string already; you don’t have to (and can’t, as seen here) escape colons inside it.

    line="elasticsearch: \" {{ elasticsearch_URL }}:{{ elasticsearch_port }} \" "
    

提交回复
热议问题