我已经在项目目录/ var / apps中使用ansible复制了ecosystem.config.js文件。但是在运行ansible脚本后,它正在查找脚本/ var / honmanagement / anisble文件夹
- name: Copy pm2 ecossystem file to cloud server
shell : cp -r ./copy_file/ecosystem.config.js /var/apps
- name: Start pm2 script using ecosystem.config.js
shell: pm2 start {{project_path}}/ecosystem.config.js
运行脚本后,出现以下错误:
fatal: [localhost]: FAILED! => {
"changed": true,
"cmd": "pm2 start /var/apps/ecosystem.config.js",
"delta": "0:00:00.219981",
"end": "2019-05-02 01:55:00.394560",
"invocation": {
"module_args": {
"_raw_params": "pm2 start /var/apps/ecosystem.config.js",
"_uses_shell": true,
"argv": null,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"stderr": "[PM2][ERROR] script not found : /var/honmanagement/ansible/HGBackend/server/server.js",
"stderr_lines": [
"[PM2][ERROR] script not found : /var/honmanagement/ansible/HGBackend/server/server.js"
],