What patterns are used in the 'when' condition of the first task?

0123

In the when condition of the first task, the following patterns are used:

  1. OS Family Check:

    • ansible_os_family == "Debian": This checks if the operating system family is Debian. It uses a comparison operator (==) to evaluate equality.
  2. 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.
  3. Variable Check:

    • check_memory | bool: This checks the value of the check_memory variable, converting it to a boolean. If check_memory is 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.

0 Comments

no data
Be the first to share your comment!