From 267ea035d2f24f094d4a8d868ecab142e479d927 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 18 Jul 2023 13:30:33 +0200 Subject: [PATCH] Do not use notify inside handlers Since latest ansible handlers are not triggered inside the same handlers flush, which means that triggering mysql restart the way we did does not work anymore. So instead of notifying inside handlers, we add listen key to tasks that are triggered by these newly produced notifications. This could be due to the bug [1], but ansible-core version that has backport included still shows inconsistent behaviour [1] https://github.com/ansible/ansible/issues/80880 Change-Id: I33a590e329cd455c9357d569867247f723d8a64a --- roles/ssh_keypairs/handlers/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/ssh_keypairs/handlers/main.yml b/roles/ssh_keypairs/handlers/main.yml index 6220877c..9251d34e 100644 --- a/roles/ssh_keypairs/handlers/main.yml +++ b/roles/ssh_keypairs/handlers/main.yml @@ -17,9 +17,10 @@ src: "/etc/ssh/trusted_ca.d/" dest: "{{ ssh_keypairs_trusted_ca_file }}" mode: "0644" - notify: Reload sshd - name: Reload sshd service: name: "sshd" state: reloaded + listen: + - Regenerate trusted_ca file