diff --git a/10/playbook_pre_post_tasks_roles_handlers.yml b/10/playbook_pre_post_tasks_roles_handlers.yml new file mode 100644 index 0000000..15015d3 --- /dev/null +++ b/10/playbook_pre_post_tasks_roles_handlers.yml @@ -0,0 +1,32 @@ +--- +- hosts: localhost + gather_facts: False + + pre_tasks: + - debug: + msg: "Schritt 1" + notify: Handler Schritt 1 + + roles: + - { role: schritt2 } + + tasks: + - debug: + msg: "Schritt 3" + notify: Handler Schritt 3 + + post_tasks: + - debug: + msg: "Schritt 4" + notify: Handler Schritt 4 + + handlers: + - name: Handler Schritt 1 + debug: msg="Handler Schritt 1" + + - name: Handler Schritt 3 + debug: msg="Handler Schritt 3" + + - name: Handler Schritt 4 + debug: msg="Handler Schritt 4" + diff --git a/10/playbook_pre_post_tasks_roles_handlers_really.yml b/10/playbook_pre_post_tasks_roles_handlers_really.yml new file mode 100644 index 0000000..a7525f1 --- /dev/null +++ b/10/playbook_pre_post_tasks_roles_handlers_really.yml @@ -0,0 +1,35 @@ +--- +- hosts: localhost + gather_facts: False + + pre_tasks: + - debug: + msg: "Schritt 1" + changed_when: True + notify: Handler Schritt 1 + + roles: + - { role: schritt2really } + + tasks: + - debug: + msg: "Schritt 3" + changed_when: True + notify: Handler Schritt 3 + + post_tasks: + - debug: + msg: "Schritt 4" + changed_when: True + notify: Handler Schritt 4 + + handlers: + - name: Handler Schritt 1 + debug: msg="Handler Schritt 1" + + - name: Handler Schritt 3 + debug: msg="Handler Schritt 3" + + - name: Handler Schritt 4 + debug: msg="Handler Schritt 4" + diff --git a/roles/schritt2/handlers/main.yml b/roles/schritt2/handlers/main.yml new file mode 100644 index 0000000..4a31abe --- /dev/null +++ b/roles/schritt2/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: Handler Schritt 2 + debug: msg="Handler Schritt 2" + diff --git a/roles/schritt2/tasks/main.yml b/roles/schritt2/tasks/main.yml new file mode 100644 index 0000000..12025ba --- /dev/null +++ b/roles/schritt2/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- debug: msg="Schritt 2" + notify: Handler Schritt 2 diff --git a/roles/schritt2really/handlers/main.yml b/roles/schritt2really/handlers/main.yml new file mode 100644 index 0000000..4a31abe --- /dev/null +++ b/roles/schritt2really/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: Handler Schritt 2 + debug: msg="Handler Schritt 2" + diff --git a/roles/schritt2really/tasks/main.yml b/roles/schritt2really/tasks/main.yml new file mode 100644 index 0000000..6c3577d --- /dev/null +++ b/roles/schritt2really/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- debug: msg="Schritt 2" + changed_when: True + notify: Handler Schritt 2