はので、私は(ansibleタスク)は:完全に間違ったことをして、
- name: inserting password into database.php
lineinfile: dest=/vagrant/htdocs/app/config/database.php insertbefore="^\s*'pgsql' => array" regexp="^\s*'password'" line=" 'password' => '',"
私configuration.ymlでこのラインを持っている理由私は見当もつかないし、私はこれを交換しようとしています:
'sqlite' => array( 'driver' => 'sqlite', 'database' => __DIR__.'/../database/production.sqlite', 'prefix' => '', ), 'mysql' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'echoit', 'username' => 'root', 'password' => 'vp45tudsdt', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'port' => 8889 ),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'forge',
'username' => 'forge',
'password' => '',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
),
私は正規表現をgrep検索してみてください。
grep "^\s*'pgsql' => array" ./htdocs/app/config/database.default.php
'pgsql' => array(
、私は他のものをgrepする:
grep "^\s*'password'" ./htdocs/app/config/database.php
'password' => 'xxxxxxx',
'password' => '',
'password' => '',
だから私の正規表現は、私が期待する正確なものと一致し が、私はそれが希望thouthとして、このbeforelineがうまく動作しない、ansibleこの機能に関するドキュメントは、それが'pgsql' => array
前の最後の試合を取るだろうと信じるように私を導いたが、それは単にどこナンプラーを決定するために使用されている。この場合'password' => '',
ああ、私はそれを気付かなかった、ありがとう。 – DenLilleMand