1 # Copyright 2018-2019 Intel Corporation and OPNFV. All rights reserved.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
17 - name: install mcelog package
22 when: install_mcelog|default(false)|bool
26 - name: check if mcelog present
27 shell: which mcelog > /dev/null
28 register: mcelog_present
30 when: install_mcelog|default(false)|bool
34 - name: build mcelog from sources if not in package
35 import_tasks: make_mcelog.yml
36 when: (mcelog_present is failed) and (install_mcelog|default(false)|bool)
40 - name: start mcelog daemon if not running
46 when: install_mcelog|default(false)|bool
50 - name: check if mcelog running on host
51 shell: ps -ef | grep mcelog | grep -v grep > /dev/null
52 register: mcelog_running
57 - name: check if mcelog exists
58 shell: which mcelog > /dev/null
59 register: mcelog_exists
64 - name: check if mcelog-client exists
66 path: /var/run/mcelog-client
67 register: mcelog_client_exists
72 - name: enable mcelog plugin
75 dest: "{{ config_file_dir }}/mcelog.conf"
76 when: (mcelog_running is succeeded) and (mcelog_exists is succeeded) and (mcelog_client_exists is succeeded)