main.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ---
  2. - name: Dependencies installed
  3. community.general.pkgng:
  4. name: git-tiny,go
  5. state: latest
  6. tags:
  7. - build
  8. - name: Source folder exists
  9. file: path=/usr/local/src mode=0755 state=directory
  10. tags:
  11. - build
  12. - name: Podgrab source deployed
  13. git:
  14. repo: "https://github.com/akhilrex/podgrab.git"
  15. dest: /usr/local/src/podgrab
  16. force: yes
  17. accept_hostkey: yes
  18. update: yes
  19. tags:
  20. - build
  21. - name: Patch podgrab for jails
  22. shell:
  23. cmd: 'sed -i -e ''s/client\/*/\/usr\/local\/src\/podgrab\/client\//'' /usr/local/src/podgrab/main.go'
  24. tags:
  25. - build
  26. - name: Podgrab binary built
  27. shell:
  28. chdir: /usr/local/src/podgrab
  29. cmd: go get github.com/mattn/go-isatty@v0.0.12 && go build .
  30. - name: Install podgrab
  31. ansible.builtin.copy:
  32. src: /usr/local/src/podgrab/podgrab
  33. dest: /usr/local/bin/podgrab
  34. remote_src: yes
  35. mode: a+x
  36. notify: Podgrab restarted
  37. - name: Podgrab assets and config moved
  38. shell:
  39. cmd: mkdir -p /var/podgrab/config && cp -r /usr/local/src/podgrab/webassets /var/podgrab/ && cp -r /usr/local/src/podgrab/client /var/podgrab/
  40. tags:
  41. - build
  42. - name: Podgrab rc file installed
  43. ansible.builtin.copy:
  44. src: podgrab.rc
  45. dest: /etc/rc.d/podgrab
  46. mode: a+x
  47. notify: Podgrab restarted
  48. - name: Podgrab enabled
  49. shell: sysrc podgrab_enable="YES"
  50. - name: Podgrab started
  51. service: name=podgrab state=started