summaryrefslogtreecommitdiffstats
path: root/examples/roles/role_with_handler
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:24:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:24:57 +0000
commit1faea9a6c75f33109e8f66b57b432fdad57b3f46 (patch)
tree4184ce38ac0cf9d5a46bbbae03c87be82927f12b /examples/roles/role_with_handler
parentAdding upstream version 6.17.2. (diff)
downloadansible-lint-1faea9a6c75f33109e8f66b57b432fdad57b3f46.tar.xz
ansible-lint-1faea9a6c75f33109e8f66b57b432fdad57b3f46.zip
Adding upstream version 24.6.1.upstream/24.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples/roles/role_with_handler')
-rw-r--r--examples/roles/role_with_handler/handlers/main.yml8
-rw-r--r--examples/roles/role_with_handler/tasks/main.yml17
2 files changed, 25 insertions, 0 deletions
diff --git a/examples/roles/role_with_handler/handlers/main.yml b/examples/roles/role_with_handler/handlers/main.yml
new file mode 100644
index 0000000..9ca1ab1
--- /dev/null
+++ b/examples/roles/role_with_handler/handlers/main.yml
@@ -0,0 +1,8 @@
+---
+- name: Debug
+ loop: "{{ _something_done.results }}"
+ loop_control:
+ label: "{{ item.item.name }}"
+ when: item.changed
+ ansible.builtin.debug:
+ msg: "{{ item.item.name }} changed"
diff --git a/examples/roles/role_with_handler/tasks/main.yml b/examples/roles/role_with_handler/tasks/main.yml
new file mode 100644
index 0000000..362dc78
--- /dev/null
+++ b/examples/roles/role_with_handler/tasks/main.yml
@@ -0,0 +1,17 @@
+---
+- name: Get info
+ delegate_to: localhost
+ register: collected_info
+ ansible.builtin.debug:
+ msg: test
+
+- name: Do something
+ delegate_to: localhost
+ loop: "{{ collected_info['some_list'] }}"
+ loop_control:
+ label: "{{ item.name }}"
+ notify:
+ - Debug
+ register: _something_done
+ ansible.builtin.debug:
+ msg: test2