Ansible playbook 部署filebeat

- hosts: all  
  tasks:
   - name: Copy Package
     copy: src=/usr/local/filebeat-6.2.2-linux-x86_64.tar.gz dest=/usr/local/filebeat-6.2.2-linux-x86_64.tar.gz
   - name: Tar Package
     shell: cd /usr/local/;tar zxvf filebeat-6.2.2-linux-x86_64.tar.gz
   - name: Rename Directory
     shell: mv /usr/local/filebeat-6.2.2-linux-x86_64 /usr/local/filebeat
   - name: Copy Profile
     copy: src=/usr/local/kafka.yml dest=/usr/local/filebeat/kafka.yml
   - name: Add rc.local
     shell: echo 'nohup /usr/local/filebeat/filebeat -e -c /usr/local/filebeat/kafka.yml >/dev/null 2>&1 &' >> /etc/rc.local
   - name: Start Service
     shell: nohup /usr/local/filebeat/filebeat -e -c /usr/local/filebeat/kafka.yml >/dev/null 2>&1 &

 

上一篇:欧盟研究推荐使用 OpenBSD 开源操作系统


下一篇:《Python入门经典》——第1章 安装和运行Python 1.1 认识操作系统