Running forever in an imminent situation Never shoots or hangs

I had an Anisble freeze problem while trying to start the forever process on Ansible node. I have a very simple API server that I create in vagrancy and provide Ansible like this:

 --- - hosts: all sudo: yes roles: - Stouts.nodejs - Stouts.mongodb tasks: - name: Install Make Dependencies apt: name={{ item }} state=present with_items: - gcc - make - build-essential - name: Run NPM Update shell: /usr/bin/npm update - name: Create MongoDB Database Folder shell: /bin/mkdir -p /data/db notify: - mongodb restart - name: Generate Dummy Data command: /usr/bin/node /vagrant/dataGen.js - name: "Install forever (to run Node.js app)." npm: name=forever global=yes state=latest - name: "Check list of Node.js apps running." command: /usr/bin/forever list register: forever_list changed_when: false - name: "Start example Node.js app." command: /usr/bin/forever start /vagrant/server.js when: "forever_list.stdout.find('/vagrant/server.js') == -1" 

But even though Ansible acts as if everything is in order, the process does not start forever. When I change a few lines to remove the when: operator and force it to start, just remove my hands, maybe start an eternal process (forever, I suppose), but do not start the virtual machine where I can interact with it.

I refer essentially to two points on the Internet; sources I can find.

+5
source share

Source: https://habr.com/ru/post/1208624/


All Articles