Re: [ansible-project] Trying to background a start up script

2020-09-03 Thread Sebastian Collins
Touché! Ok, I understand now. I thought using pm2 involved a lot of tweaking. I was trying and failing to get it to read my npm dotenv. Instead of trying to use pm2 to call my app.js directly I have just realised I can use it to launch it indirectly via npm without having to change any config . Si

Re: [ansible-project] Trying to background a start up script

2020-09-03 Thread Stefan Hornburg (Racke)
On 9/3/20 7:58 PM, Sebastian Collins wrote: > I tried the command module before using the shell module. > > I thought the command module was the wrong choice because when I run it, as > below, it simply hangs. > > If I log on to the host I can see the ansible task has spawned the node.js > proc

Re: [ansible-project] Trying to background a start up script

2020-09-03 Thread Sebastian Collins
I tried the command module before using the shell module. I thought the command module was the wrong choice because when I run it, as below, it simply hangs. If I log on to the host I can see the ansible task has spawned the node.js process but I suppose my playbook is hanging because it can't ba

Re: [ansible-project] Trying to background a start up script

2020-09-03 Thread Stefan Hornburg (Racke)
On 9/3/20 5:45 PM, Sebastian Collins wrote: > Thanks for your suggestion. PM2 actually looks really good. Great monitoring > metrics and ansible seems to > seamlessly invoke it no problem: > > - name: Task17 - start nodejs - Step1 of 3 - execute startup script > shell: pm2 start app.js >

Re: [ansible-project] Trying to background a start up script

2020-09-03 Thread Sebastian Collins
Thanks for your suggestion. PM2 actually looks really good. Great monitoring metrics and ansible seems to seamlessly invoke it no problem: - name: Task17 - start nodejs - Step1 of 3 - execute startup script shell: pm2 start app.js register: status args: chdir: "/a

Re: [ansible-project] Trying to background a start up script

2020-09-03 Thread Stefan Hornburg (Racke)
On 9/3/20 2:07 PM, Sebastian Collins wrote: > Hi, > > I have this task and I can't for the life of me get it to keep the process > running. I have added in some debug and it > shows me the process is getting shutdown almost immediately after it is > started up as can be seen by the end time in t

[ansible-project] Trying to background a start up script

2020-09-03 Thread Sebastian Collins
Hi, I have this task and I can't for the life of me get it to keep the process running. I have added in some debug and it shows me the process is getting shutdown almost immediately after it is started up as can be seen by the end time in the output I have provided below. Please advise how I ca