main.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ---
  2. # TODO: Update fluentd install and configuration when packaging is complete
  3. - name: download and install td-agent
  4. yum:
  5. name: 'http://packages.treasuredata.com/2/redhat/7/x86_64/td-agent-2.2.0-0.x86_64.rpm'
  6. state: present
  7. - name: install Kubernetes fluentd plugin
  8. command: '/opt/td-agent/embedded/bin/gem install fluent-plugin-kubernetes'
  9. - name: Creates directories
  10. file:
  11. path: "{{ item }}"
  12. state: directory
  13. group: 'td-agent'
  14. owner: 'td-agent'
  15. mode: 0755
  16. with_items: ['/etc/td-agent/config.d']
  17. - name: Add include to td-agent configuration
  18. lineinfile:
  19. dest: '/etc/td-agent/td-agent.conf'
  20. regexp: '^@include config.d'
  21. line: '@include config.d/*.conf'
  22. state: present
  23. - name: install Kubernetes fluentd configuration file
  24. template:
  25. src: kubernetes.conf.j2
  26. dest: /etc/td-agent/config.d/kubernetes.conf
  27. group: 'td-agent'
  28. owner: 'td-agent'
  29. mode: 0444
  30. - name: ensure td-agent is running
  31. service:
  32. name: 'td-agent'
  33. state: started
  34. enabled: yes