flume_conf.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. ---
  2. - name: Add SSH authorized key for synchronize Moudle
  3. authorized_key:
  4. user: root
  5. state: present
  6. key: "{{ lookup('file', '/root/.ssh/id_rsa.pub') }}"
  7. tags: flume_conf
  8. - name: Sync Flume Config Files
  9. synchronize: # need input password in command line if ssh key is none.
  10. src: conf
  11. dest: /opt/flume/apache-flume-1.8.0-bin
  12. delete: yes
  13. tags: flume_conf, flume_stop
  14. - name: Stop All Flume Agent
  15. shell: ps -ef |grep [f]lume |awk '{print $2}'|xargs kill; echo "Stop All Agent Done."
  16. tags: flume_conf, flume_stop
  17. - name: Clean Local Data
  18. file:
  19. path: /data/flume/data
  20. state: absent
  21. tags: flume_stop, flume_conf
  22. - name: Start All Flume Agent
  23. shell: "{{ item }}"
  24. with_items:
  25. - "nohup bin/flume-ng agent --conf conf --conf-file conf/nginx.access.conf --name agent01 -Dflume.root.logger=INFO,console >/dev/null 2>&1 &"
  26. - "nohup bin/flume-ng agent --conf conf --conf-file conf/backend.log.conf --name agent05 -Dflume.root.logger=INFO,console >/dev/null 2>&1 &"
  27. args:
  28. chdir: /opt/flume/apache-flume-1.8.0-bin
  29. tags: flume_conf