blob: 52e70015685eacbf198174e6bec1bf876f099f3a (
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
- name: foo
ansible.builtin.import_playbook: included.yml
- hosts: # to check if lists are allowed:
- localhost
- webservers
# validate serial allows strings like percentage value
serial: 10%
handlers:
- name: handler 1
ansible.builtin.debug:
msg: "I am handler 1"
listen: "always handler"
- name: handler 2
ansible.builtin.debug:
msg: "I am handler 2"
listen: # to check if lists are allowed:
- "list listening handler"
- "other listening topic"
- hosts: localhost
serial: 1 # validate serial allows integer
- hosts: localhost
serial: "{{ 1 }}" # jinja also ok
- hosts: localhost
serial: # validate serial allows these too:
- 123
- 10%
- "{{ some }}" # jinja also ok
- hosts: localhost
tasks:
- debug:
msg: "failed_when should accept booleans"
failed_when: false
- debug:
msg: "failed_when should allow strings"
failed_when: "'foo' in 'foobar'"
|