In the when condition of the first task, the following patterns are used:
-
OS Family Check:
ansible_os_family == "Debian": This checks if the operating system family is Debian. It uses a comparison operator (==) to evaluate equality.
-
Memory Check:
ansible_memtotal_mb > 1024: This checks if the total memory in megabytes is greater than 1024. It uses a comparison operator (>) to evaluate if the condition is true.
-
Variable Check:
check_memory | bool: This checks the value of thecheck_memoryvariable, converting it to a boolean. Ifcheck_memoryis true, this condition passes.
Summary
The when condition combines these patterns using logical AND, meaning all conditions must be true for the task to execute. This allows for precise control over task execution based on multiple criteria.
