playbook handlers

# vim handlers.yml
---
- name: handler_test
  hosts: testhosts
  user: root
  tasks:
    - name: copy file
      copy: src=/etc/passwd dest=/tmp/aaa.txt     当对方机器上有对应的文件的时候是不会调用 handlers 的
      notify: test handlers
  handlers:
    - name: test handlers
      shell: echo "11111" >> /tmp/aaa.txt

你可能感兴趣的:(playbook handlers)