Combining Conditions with and / or
Build compound when expressions.
More Than One Rule
Real decisions need several rules at once. Ansible lets you combine tests with and and or inside a single when. 🔗
Both Must Be True
With and, every part must hold. This task runs only on Debian hosts that also requested the extras.
when: ansible_os_family == "Debian" and install_extrasAll lessons in this course
- Run a Task Only when True
- Branch on OS Family Facts
- Combining Conditions with and / or
- Register a Result, Then Decide