From b0f6aef7a2938a0fb836e4f9f5134912287acd9e Mon Sep 17 00:00:00 2001 From: Przemyslaw Lal Date: Wed, 1 Apr 2020 09:05:45 +0100 Subject: [PATCH] sst-bf: skip sst-bf.py execution on kernel versions lower than 5.1 Signed-off-by: Przemyslaw Lal --- roles/sst-bf-configure/tasks/main.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/sst-bf-configure/tasks/main.yml b/roles/sst-bf-configure/tasks/main.yml index 17ab733a..d2c3ce3b 100644 --- a/roles/sst-bf-configure/tasks/main.yml +++ b/roles/sst-bf-configure/tasks/main.yml @@ -55,15 +55,22 @@ fail_msg: "The 'sst_bf_mode' variable must be set to 's', 'm' or 'r'. Please update your host vars." when: sst_bf_configuration_enabled +- pause: + prompt: "Warning: SST-BF configuration cannot be applied - Linux kernel version is lower than 5.1" + seconds: 10 + when: ansible_kernel is version_compare('5.1','<') + - name: configure CPU on node on Debian based distro command: sst_bf.py -{{ sst_bf_mode }} when: - sst_bf_configuration_enabled - ansible_os_family == "Debian" + - ansible_kernel is version_compare('5.1','>=') - name: configure CPU on node on RHEL 7 based distro shell: source /opt/rh/rh-python36/enable && /usr/local/bin/sst_bf.py -{{ sst_bf_mode }} when: - sst_bf_configuration_enabled - ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat' - - ansible_distribution_version < '8' \ No newline at end of file + - ansible_distribution_version < '8' + - ansible_kernel is version_compare('5.1','>=')