summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/rule-no-handler-fail.yml
blob: 3bc23a39962c6a65289cbde68d2d1564517fca59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
- name: Example of no-handler rule
  hosts: localhost
  tasks:
    - name: Register result of a task
      ansible.builtin.copy:
        dest: "/tmp/placeholder"
        content: "Ansible made this!"
        mode: "0600"
      register: result # <-- we register the result of the task

    - name: Second command to run
      ansible.builtin.debug:
        msg: The placeholder file was modified!
      when: result.changed # <-- this triggers no-handler rule