Some modules, such as the
copy module, provide mechanisms to configure it to skip the execution of the module. You can also configure your own skip conditions that will only execute the module if they resolve to
true. This can be handy if your servers use different packaging systems or have different filesystem layouts. It can also be used with the
set_fact module to allow you to compute many different things.
To skip a module, you can use the
when key; this lets you provide a condition. If the condition you set resolves to false, then the module will be skipped. The value that you assign to
when is a Python expression. You can use any of the variables or facts available to you at this point.
If you want to process some ...