main.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. 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. warn: false
  25. tags:
  26. - build
  27. - name: Build podgrab binary
  28. shell:
  29. chdir: /usr/local/src/podgrab
  30. cmd: go get github.com/mattn/go-isatty@v0.0.12 && go build .
  31. tags:
  32. - build
  33. - name: Podgrab rc file installed
  34. ansible.builtin.copy:
  35. src: podgrab.rc
  36. dest: /usr/local/etc/rc.d/podgrab
  37. mode: a+x
  38. - name: Podgrab enabled
  39. shell: sysrc podgrab_enable="YES"
  40. - name: Install podgrab
  41. ansible.builtin.copy:
  42. src: /usr/local/src/podgrab/podgrab
  43. dest: /usr/local/bin/podgrab
  44. remote_src: yes
  45. mode: a+x
  46. notify: Podgrab restarted
  47. - name: Podgrab started
  48. service: name=podgrab state=started