用Ansible替换配置行

时间:2017-05-06 20:29:00

标签: php linux automation vagrant ansible

文件:

app.php

说明

我想用以下代码替换第11行:

$kernel = new AppKernel('dev', true);

而不是:

$kernel = new AppKernel('prod', false);

main.yml文件:

我正在尝试这样做,但不起作用:

- name: Change to Symfony development enviroment for reflect the changes directly on the vagrant box replace: dest=/vagrant/symfony-standard/web/app.php regexp='$kernel = new AppKernel('prod', false);' replace='$kernel = new AppKernel('dev', true);' backup=yes

终端

TASK [symfony-standard : Change to Symfony development enviroment for reflect the changes directly on the vagrant box] *** task path: /vagrant/playbooks/roles/symfony-standard/tasks/main.yml:49 ok: [default] => {"changed": false, "msg": ""}

0 个答案:

没有答案