.. _blocks: Blocks ====== * `Blocks doc `_ * `A blog post about blocks `_ * `Blog post with examples `_ * `Complete list of possible keywords `_ Blocks can be used anywhere a task can (mostly?). They allow applying task keys to a group of tasks without having to repeat them over and over. They also provide a form of error handling. Syntax:: block: - - when: become: true become_user: .... [rescue: - debug: msg="This task runs if there's an error in the block" - ... always: - debug: msg="I always run" ... more tasks .. ]