main.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---
  2. - name: Dependencies installed
  3. community.general.pkgng:
  4. name: "ffmpeg"
  5. state: latest
  6. - name: Timelapse www folder exists
  7. file:
  8. path: /var/www/timelapse
  9. owner: root
  10. mode: 0755
  11. state: directory
  12. - name: Index html file installed
  13. copy:
  14. src: "index.html"
  15. dest: "/var/www/timelapse/index.html"
  16. mode: 0644
  17. notify: Nginx restarted
  18. - name: East cam file linked
  19. file: src=/media/photos/webcams/timelapse/east-cam.mp4 dest=/var/www/timelapse/east-cam.mp4 state=link
  20. - name: West cam file linked
  21. file: src=/media/photos/webcams/timelapse/west-cam.mp4 dest=/var/www/timelapse/west-cam.mp4 state=link
  22. - name: Nginx conf file installed
  23. copy:
  24. src: "nginx.conf"
  25. dest: "/usr/local/etc/nginx/locations/timelapse.conf"
  26. mode: 0644
  27. notify: Nginx restarted
  28. - name: timelapse_go script installed
  29. copy:
  30. src: "timelapse_go.sh"
  31. dest: /usr/local/bin/timelapse_go
  32. mode: 0775
  33. - name: Run timelapse_go every 12 hours
  34. ansible.builtin.cron:
  35. name: "timelapse_go"
  36. hour: "*/12"
  37. job: "/usr/local/bin/timelapse_go > /dev/null"