From bc44c73f1b0ab7e95cd29396f7416a0371a56474 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 21 Oct 2023 23:52:26 +0300
Subject: [PATCH] Router: Small fix.

The first time unbound-anchor is run the exit code is 1.
---
 Ansible/roles/router/tasks/main.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Ansible/roles/router/tasks/main.yaml b/Ansible/roles/router/tasks/main.yaml
index 660d1f7..5feb041 100644
--- a/Ansible/roles/router/tasks/main.yaml
+++ b/Ansible/roles/router/tasks/main.yaml
@@ -44,6 +44,8 @@
   ansible.builtin.command:
     cmd: /usr/sbin/unbound-anchor -a /var/unbound/db/root.key
     creates: /var/unbound/db/root.key
+  register: router_unbound_anchor
+  failed_when: router_unbound_anchor.rc not in [0, 1]
   tags:
     - network
     - dns
-- 
GitLab