main.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. ---
  2. - name: Dependencies installed
  3. community.general.pkgng:
  4. name: git,go,openblas,cblas,dlib-cpp,lapacke,libjpeg-turbo,npm-node14,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. # We have to comment out:
  49. # vi ~/go/pkg/mod/github.com/strukturag/libheif@v1.12.0/go/heif/heif.go
  50. # line 269
  51. - name: Hack libheif to work with FreeBSD
  52. shell:
  53. cmd: 'sed -i -e "/suberrorwrongtileimagepixeldepth = C.heif_suberror_Wrong_tile_image_pixel_depth/d" /root/go/pkg/mod/github.com/strukturag/libheif@v1.12.0/go/heif/heif.go'
  54. warn: false
  55. - name: API env file installed
  56. template:
  57. src: api.env.j2
  58. dest: /usr/local/src/photoview/api/.env
  59. owner: root
  60. mode: 0600
  61. - name: UI env file installed
  62. template:
  63. src: ui.env.j2
  64. dest: /usr/local/src/photoview/ui/.env
  65. owner: root
  66. mode: 0600
  67. - name: Photoview UI installed
  68. shell:
  69. cmd: npm install && npm run build
  70. chdir: /usr/local/src/photoview/ui
  71. - name: Photoview API built
  72. shell:
  73. cmd: go build .
  74. chdir: /usr/local/src/photoview/api
  75. - name: Nginx location file installed
  76. ansible.builtin.copy:
  77. src: nginx.conf
  78. dest: /usr/local/etc/nginx/locations/photoview.conf
  79. notify: Nginx restarted
  80. - name: Photoview immortal file installed
  81. template:
  82. src: immortal.yml.j2
  83. dest: /usr/local/etc/immortal/photoview.yml
  84. owner: root
  85. mode: 0664
  86. notify: Immortal restarted