When you run in
--check mode, shell module is skipped. If you use it to
register some variables, you might want to add a
when_set condition to plays that use this variable in templates, so template generation doesn't break.
Here is an example :
- name: Tmux | Gets installed Tmux version
shell: tmux -V
- name: Tmux | Adds .tmux.conf for user
template: src=tpl/tmux.j2 dest=~user/.tmux.conf
In check mode, shell module is skipped, so without the
when_set here, if you'd use
$tmux_version in the template , the module would bail out complaining about an undefined variable.