1 #Copyright 2018 OPNFV and Intel Corporation
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.
16 - name: install mcelog package
21 when: install_mcelog|default(false)|bool
25 - name: check if mcelog present
26 shell: which mcelog > /dev/null
27 register: mcelog_present
29 when: install_mcelog|default(false)|bool
33 - name: build mcelog from sources if not in package
34 import_tasks: make_mcelog.yml
35 when: mcelog_present|failed and install_mcelog|default(false)|bool
39 - name: start mcelog daemon if not running
45 when: install_mcelog|default(false)|bool
49 - name: check if mcelog running on host
50 shell: ps -ef | grep mcelog | grep -v grep > /dev/null
51 register: mcelog_running
56 - name: check if mcelog exists
57 shell: which mcelog > /dev/null
58 register: mcelog_exists
63 - name: check if mcelog-client exists
65 path: /var/run/mcelog-client
66 register: mcelog_client_exists
71 - name: enable mcelog plugin
74 dest: "{{ config_file_dir }}/mcelog.conf"
75 when: mcelog_running|succeeded and mcelog_exists|succeeded and mcelog_client_exists|succeeded