diff --git a/blocks.yml b/blocks.yml new file mode 100644 index 0000000..c2e7486 --- /dev/null +++ b/blocks.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' diff --git a/pre_post_tasks.yml b/pre_post_tasks.yml new file mode 100644 index 0000000..c8d051d --- /dev/null +++ b/pre_post_tasks.yml @@ -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