From 5d3326b93f15149e33ae01639e8dbb4101ca8522 Mon Sep 17 00:00:00 2001
From: Kay Yan <yankay@users.noreply.github.com>
Date: Thu, 22 Sep 2022 14:55:05 +0800
Subject: [PATCH] add-ping-package (#9284)

---
 .../preinstall/tasks/0020-verify-settings.yml      | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
index f9285811a..9f346d8ab 100644
--- a/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
+++ b/roles/kubernetes/preinstall/tasks/0020-verify-settings.yml
@@ -100,6 +100,20 @@
     - not ignore_assert_errors
     - ip is defined
 
+- name: Ensure ping package
+  package:
+    name: >-
+          {%- if ansible_os_family in ['RedHat', 'Suse'] -%}
+          iputils
+          {%- else -%}
+          iputils-ping
+          {%- endif -%}
+    state: present
+  when:
+    - access_ip is defined
+    - not ignore_assert_errors
+    - ping_access_ip
+
 - name: Stop if access_ip is not pingable
   command: ping -c1 {{ access_ip }}
   when:
-- 
GitLab