main.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ---
  2. - name: Dependencies installed
  3. community.general.pkgng:
  4. name: git,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. accept_hostkey: yes
  17. update: yes
  18. tags:
  19. - build
  20. - name: Patch podgrab for jails
  21. shell:
  22. cmd: 'sed -i -e ''s/client\/*/\/usr\/local\/src\/podgrab\/client\//'' /usr/local/src/podgrab/main.go'
  23. warn: false
  24. tags:
  25. - build
  26. - name: Build podgrab binary
  27. shell:
  28. chdir: /usr/local/src/podgrab
  29. cmd: go build .
  30. tags:
  31. - build
  32. - name: Podgrab rc file installed
  33. ansible.builtin.copy:
  34. src: podgrab.rc
  35. dest: /usr/local/etc/rc.d/podgrab
  36. mode: a+x
  37. - name: Podgrab enabled
  38. shell: sysrc podgrab_enable="YES"
  39. - name: Install podgrab
  40. ansible.builtin.copy:
  41. src: /usr/local/src/podgrab/podgrab
  42. dest: /usr/local/bin/podgrab
  43. remote_src: yes
  44. notify: Podgrab restarted