playbook
Posted abkn
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了playbook相关的知识,希望对你有一定的参考价值。
1 --- 2 - hosts: web-server 3 remote_user: root 4 tasks: 5 - name: stop logstash 6 shell: PID=`ps -ef | grep logstash | grep -v grep | awk ‘{print $2}‘`; if [ $PID ];then kill -9 $PID && echo "rm ok";fi 7 - name: rm old logstash 8 shell: rm -rf /data1/elk/logstash* 9 - name: cp new logstash 10 copy: src=/home/dev/playbook/conf.zip dest=/data1/elk/conf.zip 11 - name: unzip 12 shell: /usr/bin/unzip -o /data1/elk/conf.zip -d /data1/elk/logstash-6.5.1/ 13 - name: cp new logstash 14 copy: src=/home/dev/playbook/conf.zip dest=/data1/elk/conf.zip 15 - name: unzip 16 shell: /usr/bin/unzip -o /data1/elk/conf.zip -d /data1/elk/logstash-6.5.1/
以上是关于playbook的主要内容,如果未能解决你的问题,请参考以下文章