From 360dd095883d1a1f9986fa0fe7a75b99445074ec Mon Sep 17 00:00:00 2001 From: liubo Date: Tue, 5 Nov 2019 15:05:13 +0800 Subject: [PATCH 1/2] check systemd version --- roles/check_system_static/tasks/main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/roles/check_system_static/tasks/main.yml b/roles/check_system_static/tasks/main.yml index 879504db3..f9c02e49c 100644 --- a/roles/check_system_static/tasks/main.yml +++ b/roles/check_system_static/tasks/main.yml @@ -19,6 +19,25 @@ - ansible_distribution in ['CentOS', 'RedHat'] - ansible_distribution_major_version != '7' +- name: Get systemd info + yum: + list: systemd + register: systemd_info + when: ansible_os_family == 'RedHat' + +- set_fact: + systemd_version: "{{ systemd_info.results | json_query(query) }}" + vars: + query: "[?yumstate=='installed'].release" + when: ansible_os_family == 'RedHat' + +- name: Preflight check - Systemd version + fail: + msg: "Current systemd release is {{ systemd_version }} (below 52.el7), there are some memory bugs. Refer to https://access.redhat.com/discussions/3536621" + when: + - ansible_os_family == 'RedHat' + - systemd_version.stdout < '52.el7' + - name: Deploy epollexclusive script copy: src="{{ script_dir }}/check/epollexclusive" dest="{{ deploy_dir }}/epollexclusive" mode=0755 From f8b3488ab39fbb1a7da772d5b577ae3b1e1bd2c8 Mon Sep 17 00:00:00 2001 From: liubo Date: Mon, 2 Dec 2019 15:56:16 +0800 Subject: [PATCH 2/2] Update roles/check_system_static/tasks/main.yml --- roles/check_system_static/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/check_system_static/tasks/main.yml b/roles/check_system_static/tasks/main.yml index f9c02e49c..c7164b591 100644 --- a/roles/check_system_static/tasks/main.yml +++ b/roles/check_system_static/tasks/main.yml @@ -36,7 +36,7 @@ msg: "Current systemd release is {{ systemd_version }} (below 52.el7), there are some memory bugs. Refer to https://access.redhat.com/discussions/3536621" when: - ansible_os_family == 'RedHat' - - systemd_version.stdout < '52.el7' + - systemd_version[0] < '52.el7' - name: Deploy epollexclusive script copy: src="{{ script_dir }}/check/epollexclusive" dest="{{ deploy_dir }}/epollexclusive" mode=0755