pre_post_tasks
Eamonn Travers 6 years ago
parent 27d91b389d
commit be4a482b89
  1. 13
      blocks.yml
  2. 19
      pre_post_tasks.yml

@ -0,0 +1,13 @@
---
- hosts: localhost
tasks:
- block:
- debug: msg='OK'
- shell: /bin/false
- debug: msg='Never'
rescue:
- debug: msg='ERR'
- shell: /bin/false
- debug: msg='Never again'
always:
- debug: msg='Always'

@ -0,0 +1,19 @@
---
- hosts: localhost
pre_tasks:
- name: Create a FACT
set_fact:
test_fact: test_fact
tags:
always
tasks:
- name: Print a msg
debug:
msg: This far
post_tasks:
- name: Get a FACT
setup:
filter: test_fact
Loading…
Cancel
Save