forked from lorin/ansiblebook
-
Couldn't load subscription status.
- Fork 337
Conditional
Bas edited this page Feb 27, 2023
·
2 revisions
A conditional is an expression that evaluates to true or false that decides whether a given task is executed on a given machine or not. Ansible’s conditionals are powered by the ‘when’ statement.
- name: Do stuff on unix
include_tasks: unix.yml
when: ansible_os_family != 'Windows'
- name: Do stuff on Windows
include_tasks: windows.yml
when: ansible_os_family == 'Windows'