main.yml 784 B

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. - name: Dependencies installed
  3. community.general.pkgng:
  4. name: gtar
  5. state: latest
  6. - name: Loki fetched
  7. get_url:
  8. url: https://github.com/grafana/loki/releases/download/v2.4.1/loki-freebsd-amd64.zip
  9. dest: /usr/local/bin/loki.zip
  10. - name: Loki binary unpacked
  11. command: "unzip -o /usr/local/bin/loki.zip"
  12. args:
  13. chdir: /usr/local/bin
  14. warn: false
  15. - name: Loki rc file installed
  16. ansible.builtin.copy:
  17. src: loki.rc
  18. dest: /usr/local/etc/rc.d/loki
  19. mode: a+x
  20. - name: Loki enabled
  21. shell: sysrc loki_enable="YES"
  22. - name: Loki config file installed
  23. template:
  24. src: loki.config.yml.j2
  25. dest: /usr/local/etc/loki.config.yml
  26. owner: root
  27. mode: 0644
  28. notify: Loki restarted
  29. - name: Loki started
  30. service: name=loki state=started