From e7729daefc59c985953f80cc7e0d472a58d9bf6e Mon Sep 17 00:00:00 2001
From: Citrullin <philipp-blum@desertmonitor.com>
Date: Wed, 8 Jun 2022 17:37:48 +0200
Subject: [PATCH] Add assertion for IPv6 in verify settings

Co-authored-by: Kenichi Omichi <ken1ohmichi@gmail.com>
---
 roles/kubernetes/preinstall/tasks/0020-verify-settings.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
index ada80220e..9f5b0d5fb 100644
--- a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
+++ b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
@@ -94,8 +94,8 @@
 
 - name: Stop if ip var does not match local ips
   assert:
-    that: ip in ansible_all_ipv4_addresses
-    msg: "'{{ ansible_all_ipv4_addresses }}' do not contain '{{ ip }}'"
+    that: (ip in ansible_all_ipv4_addresses) or (ip in ansible_all_ipv6_addresses)
+    msg: "IPv4: '{{ ansible_all_ipv4_addresses }}' and IPv6: '{{ ansible_all_ipv6_addresses }}' do not contain '{{ ip }}'"
   when:
     - not ignore_assert_errors
     - ip is defined
-- 
GitLab