From 27094d0a7e8b084efe17f24415ceed5e69679578 Mon Sep 17 00:00:00 2001 From: gjmzj Date: Wed, 6 Mar 2019 22:58:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcilium=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E6=97=B6=E5=88=A4=E6=96=AD=E5=86=85=E6=A0=B8=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/cilium/tasks/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/cilium/tasks/main.yml b/roles/cilium/tasks/main.yml index ff2b56f..efb49a0 100644 --- a/roles/cilium/tasks/main.yml +++ b/roles/cilium/tasks/main.yml @@ -9,9 +9,13 @@ delegate_to: "{{ groups.deploy[0] }}" run_once: true +- name: 转换内核版本为浮点数 + set_fact: + KERNEL_VER: "{{ ansible_kernel.split('-')[0].split('.')[0]|int + ansible_kernel.split('-')[0].split('.')[1]|int/100 }}" + - name: 检查内核版本>4.9 fail: msg="kernel {{ ansible_kernel }} is too old for cilium installing" - when: "ansible_kernel.split('-')[0].split('.')[0]|int < 4 or ansible_kernel.split('-')[0].split('.')[1]|int < 10" + when: "KERNEL_VER <= 4.09" - name: 检查是否已下载离线cilium镜像 command: "ls {{ base_dir }}/down"