main.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. - name: Dependencies installed
  3. community.general.pkgng:
  4. name: py38-pip,py38-pillow,git-tiny,py38-psycopg2,nginx
  5. state: latest
  6. - name: Source folder exists
  7. file:
  8. path: /usr/local/src
  9. owner: root
  10. mode: 0755
  11. state: directory
  12. - name: Emus source @ master
  13. git:
  14. repo: "https://code.unbl.ink/secstate/emus"
  15. dest: /usr/local/src/emus
  16. update: yes
  17. force: yes
  18. tags:
  19. - update
  20. - name: Emus conf file installed
  21. template:
  22. src: emus.conf.j2
  23. dest: /usr/local/etc/emus.conf
  24. owner: root
  25. mode: 0600
  26. - name: Skyscraper conf file installed template:
  27. src: skyscraper.ini.j2
  28. dest: /usr/local/etc/skyscraper.ini
  29. owner: root
  30. mode: 0600
  31. - name: Poetry installed
  32. pip:
  33. name: poetry
  34. - name: Emus dependecies installed
  35. command: poetry install
  36. args:
  37. chdir: /usr/local/src/emus
  38. - name: Emus migrations up to date
  39. command: poetry run python manage.py migrate
  40. args:
  41. chdir: /usr/local/src/emus
  42. - name: Emus migrations up to date
  43. command: poetry run python manage.py collectstatic --noinput
  44. args:
  45. chdir: /usr/local/src/emus
  46. - name: Emus immortal file installed
  47. template:
  48. src: emus.yml.j2
  49. dest: /usr/local/etc/immortal/emus.yml
  50. owner: root
  51. mode: 0600
  52. notify: Immortal restarted