From e89bd7956e02de3eda5495c1a6a2fedbbd098534 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Mon, 18 Nov 2024 15:21:19 +0100 Subject: [PATCH] feat: create handlers in top-level Signed-off-by: Matej Focko --- handlers/main.yml | 6 ++++++ playbooks/bootstrap.yml | 4 ++++ playbooks/playground.yml | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 handlers/main.yml diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..1156b0b --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,6 @@ +--- +- name: Restart nginx + ansible.builtin.service: + name: nginx + state: restarted + become: true diff --git a/playbooks/bootstrap.yml b/playbooks/bootstrap.yml index f8bf6d7..645eedd 100644 --- a/playbooks/bootstrap.yml +++ b/playbooks/bootstrap.yml @@ -112,3 +112,7 @@ wg_address: "{{ item.address }}" wg_peers: "{{ item.peers }}" tags: wireguard + + handlers: + - name: Import common handlers + ansible.builtin.import_tasks: ../handlers/main.yml diff --git a/playbooks/playground.yml b/playbooks/playground.yml index e516b6a..3b69e6d 100644 --- a/playbooks/playground.yml +++ b/playbooks/playground.yml @@ -3,3 +3,6 @@ hosts: all gather_facts: true roles: [] + handlers: + - name: Import common handlers + ansible.builtin.import_tasks: ../handlers/main.yml