playbook样例
1 --- 2 - host: web 3 remote_user: root 4 5 task: 6 - name: add group 7 tags: user 8 user: name=nginx state=present group=nginx 9 - name: install nginx 10 yum: name=nginx state=present 11 - name: config 12 copy: src=/root/config.txt dest=/etc/nginx/nginx.conf 13 notify: 14 - Restart Nginx 15 - Check Nginx Process 16 handlers: 17 - name: Restart Nginx 18 service: name=nginx state=restarted enabled=yes 19 - name: Check Nginx process 20 shell: killall -0 nhinx > /tmp/nginx.log 21
浙公网安备 33010602011771号