main.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ---
  2. - name: Dependencies installed
  3. community.general.pkgng:
  4. name: git,go,openblas,cblas,dlib-cpp,lapacke,libjpeg-turbo,npm-node20,darktable,ffmpeg,p5-Image-ExifTool,pkgconf,libheif,bash
  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: Libraries for jpeglib linked
  13. file: src=/usr/local/include/jpeglib.h dest=/usr/include/jpeglib.h state=link
  14. - name: Libraries for jconfig linked
  15. file: src=/usr/local/include/jconfig.h dest=/usr/include/jconfig.h state=link
  16. - name: Libraries for jmorecfg linked
  17. file: src=/usr/local/include/jmorecfg.h dest=/usr/include/jmorecfg.h state=link
  18. - name: Libraries for dlib linked
  19. file: src=/usr/local/include/dlib dest=/usr/include/dlib state=link
  20. - name: Libraries for lapacke linked
  21. file: src=/usr/local/include/lapacke.h dest=/usr/include/lpacke.h state=link
  22. - name: Libraries for lapacke linked
  23. file: src=/usr/local/include/lapacke_utils.h dest=/usr/include/lapacke_utils.h state=link
  24. - name: Libraries for lapacke linked
  25. file: src=/usr/local/include/lapacke_mangling.h dest=/usr/include/lapacke_mangling.h state=link
  26. - name: Library for dlib linked
  27. file: src=/usr/local/lib/libdlib.so dest=/usr/lib/libdlib.so state=link
  28. - name: Libraries for cblas linked
  29. file: src=/usr/local/include/cblas.h dest=/usr/include/cblas.h state=link
  30. - name: Link lapack libraries
  31. shell: "ln -s /usr/local/lib/liblapack* /usr/lib/"
  32. ignore_errors: true
  33. - name: Link jpeg libraries
  34. shell: "ln -s /usr/local/lib/libjpeg* /usr/lib/"
  35. ignore_errors: true
  36. - name: Link cblas libraries
  37. shell: "ln -s /usr/local/lib/libcblas* /usr/lib/"
  38. ignore_errors: true
  39. - name: Link openblas libraries
  40. shell: "ln -s /usr/local/lib/libblas* /usr/lib/"
  41. ignore_errors: true
  42. - name: Photoview source @ master
  43. git:
  44. repo: "https://github.com/photoview/photoview.git"
  45. dest: /usr/local/src/photoview
  46. update: yes
  47. force: yes
  48. - name: API env file installed
  49. template:
  50. src: api.env.j2
  51. dest: /usr/local/src/photoview/api/.env
  52. owner: root
  53. mode: 0600
  54. - name: UI env file installed
  55. template:
  56. src: ui.env.j2
  57. dest: /usr/local/src/photoview/ui/.env
  58. owner: root
  59. mode: 0600
  60. - name: Photoview UI installed
  61. shell:
  62. cmd: npm install && npm run build
  63. chdir: /usr/local/src/photoview/ui
  64. - name: Photoview API built
  65. shell:
  66. cmd: go build .
  67. chdir: /usr/local/src/photoview/api
  68. - name: Nginx location file installed
  69. ansible.builtin.copy:
  70. src: nginx.conf
  71. dest: /usr/local/etc/nginx/locations/photoview.conf
  72. notify: Nginx restarted
  73. - name: Photoview immortal file installed
  74. template:
  75. src: immortal.yml.j2
  76. dest: /usr/local/etc/immortal/photoview.yml
  77. owner: root
  78. mode: 0664
  79. notify: Immortal restarted