main.yml 583 B

123456789101112131415161718192021222324252627
  1. ---
  2. - name: Logstash installed
  3. community.general.pkgng:
  4. name: "logstash7"
  5. state: latest
  6. - name: Logstash enabled
  7. shell: sysrc logstash_enable="YES"
  8. - name: Logstash config file installed
  9. copy:
  10. src: logstash.yml
  11. dest: /usr/local/etc/logstash/logstash.conf
  12. owner: root
  13. mode: 0664
  14. notify: Logstash restarted
  15. - name: Logstash config file installed
  16. copy:
  17. src: pipeline.conf
  18. dest: /usr/local/etc/logstash/pipeline.conf
  19. owner: root
  20. mode: 0664
  21. notify: Logstash restarted
  22. - name: Logstash started
  23. service: name=logstash state=started