1
0

main.yml 727 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. ---
  2. - name: ensure gancio user is present
  3. user:
  4. name: "gancio"
  5. home: "/srv/gancio"
  6. shell: "/bin/bash"
  7. state: present
  8. - name: NODE | Install pm2
  9. npm:
  10. name: pm2
  11. global: yes
  12. production: yes
  13. state: present
  14. - name: NODE | Install gancio
  15. npm:
  16. executable: /usr/bin/npm --unsafe-perm=true --allow-root
  17. name: gancio
  18. global: yes
  19. production: yes
  20. state: present
  21. - name: Copy settings
  22. template:
  23. src: config.json.j2
  24. dest: /srv/gancio/config.json
  25. owner: gancio
  26. group: gancio
  27. mode: 0660
  28. - name: NODE | Start APP
  29. become: true
  30. become_user: gancio
  31. shell: pm2 start gancio -- start --config config.json
  32. args:
  33. chdir: /srv/gancio
  34. ignore_errors: yes