I am trying to replace localhost
in the string
$amp_conf['AMPDBHOST'] = 'localhost';
with the content of the variable {{ asterisk_db_host }}
, which is 172.17.0.3
.
Even though
- replace:
dest: /usr/src/freepbx/installlib/installcommand.class.php
regexp: '(\$amp_conf\[.AMPDBHOST.\] = .)localhost(.;)'
replace: '\1\2'
perfectly results in
$amp_conf['AMPDBHOST'] = 'localhost';
- replace:
dest: /usr/src/freepbx/installlib/installcommand.class.php
regexp: '(\$amp_conf\[.AMPDBHOST.\] = .)localhost(.;)'
replace: '\1{{ asterisk_db_host }}\2'
as well as
- replace:
dest: /usr/src/freepbx/installlib/installcommand.class.php
regexp: '(\$amp_conf\[.AMPDBHOST.\] = .)localhost(.;)'
replace: '\1{{ asterisk_db_host|regex_escape() }}\2'
replace the string with O2.17.0.2';
or O2\.17\.0\.2';
.
What am I doing wrong here? How can I properly do this replacement?