From 97b26f90c81ff0bd276d4c80a96f4fd8b8a88f52 Mon Sep 17 00:00:00 2001 From: Norman Ziegner Date: Mon, 18 Aug 2025 15:36:09 +0200 Subject: [PATCH] keepalived role: use validate parameter to check config file Signed-off-by: Norman Ziegner --- roles/keepalived/tasks/main.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/roles/keepalived/tasks/main.yml b/roles/keepalived/tasks/main.yml index e40ba664..d56bfd8c 100644 --- a/roles/keepalived/tasks/main.yml +++ b/roles/keepalived/tasks/main.yml @@ -138,15 +138,9 @@ owner: "root" group: "root" mode: "0644" + validate: "{{ __keepalived_binary.stat.exists | ternary(keepalived_executable_path ~ ' --config-test --use-file %s', omit) }}" notify: "Reload Keepalived" -- name: "Verify Keepalived configuration." - become: true - ansible.builtin.command: - cmd: "{{ keepalived_executable_path | quote }} --config-test --use-file {{ keepalived_conf_file_path | quote }}" - register: "__config_check" - changed_when: "__config_check.rc != 0" - - name: "Create Keepalived Service Unit File." ansible.builtin.template: src: "{{ keepalived_service_template }}"