Error script not found when suing ansible playbook to start an application using pm2

0 votes

I have written an ansible task to start my project. Below is the task:

- name: To Start a App
    command: pm2 start index.js --name Tracker-US chdir= /home/ubuntu/tracker-u$
    ignore_errors: yes
    when: npm_finished.changed

I got the following error:

fatal: [18.209.197.33]: FAILED! => {"changed": true, "cmd": ["pm2", "start", "index.js", "--name", "Tracker-US", "/home/ubuntu/tracker-us/"], "delta": "0:00:00.716599", "end": "2019-09-04 05:24:18.904163", "msg": "non-zero return code", "rc": 1, "start": "2019-09-04 05:24:18.187564", "stderr": "[PM2][ERROR] script not found : /home/ubuntu/index.js\nscript not found : /home/ubuntu/index.js", "stderr_lines": ["[PM2][ERROR] script not found : /home/ubuntu/index.js", "script not found : /home/ubuntu/index.js"], "stdout":
Sep 4, 2019 in Ansible by Tara
1,171 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Ansible

0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Is it possible to run an Ansible Playbook in python script?

Hey @Cerci, Of course its possible. You ...READ MORE

answered Jan 17, 2019 in Ansible by Nicolas
15,668 views
0 votes
1 answer
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,035 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP