diff --git a/roles/check_system_static/tasks/main.yml b/roles/check_system_static/tasks/main.yml index 879504db3..c7164b591 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[0] < '52.el7' + - name: Deploy epollexclusive script copy: src="{{ script_dir }}/check/epollexclusive" dest="{{ deploy_dir }}/epollexclusive" mode=0755