Condition When
---
- name: test when condition
hosts: localhost
gather_facts: no
vars:
seq:
- 1
- 2
- 3
- 4
- 5
tasks:
- name: test loop and when
debug:
msg: "{{ item }}"
with_items: "{{ seq }}"
when: item >= 3
[root@master ~]# ansible-playbook /home/ansible-study/playbook/condition/when.yml