summaryrefslogtreecommitdiff
path: root/test/playbook-changed_when.yml
blob: 9625d5d6551b8f0c23bf0477cbadce2dcd539f11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
- hosts: all
  connection: local
  gather_facts: False

  tasks:
  - action: command echo first action
  - action: command echo second action
    register: var
    changed_when: "'X' in var.stdout"
  - action: shell exit 2
    register: exit
    ignore_errors: yes
    changed_when: "exit.rc < 1"
  - action: command echo third action
    changed_when: false
  - action: file path=/ state=directory
    changed_when: true
  - action: command echo {{item}}
    register: out
    changed_when: "'e' in out.stdout"
    with_items:
      - hello
      - foo
      - bye