Revert "Merge conflict"
[barometer.git] / docker / ansible / roles / config_files / tasks / mcelog.yml
1 #Copyright 2018 OPNFV and Intel Corporation
2 #
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
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14 ---
15
16 - name: check if mcelog running on host
17   shell: ps -ef | grep mcelog | grep -v grep > /dev/null
18   register: mcelog_running
19   ignore_errors: "true"
20   tags:
21     - mcelogs
22
23 - name: check if mcelog exists
24   shell: which mcelog > /dev/null
25   register: mcelog_exists
26   ignore_errors: "true"
27   tags:
28     - mcelogs
29
30 - name: check if mcelog-client exists
31   stat:
32     path: /var/run/mcelog-client
33   register: mcelog_client_exists
34   ignore_errors: "true"
35   tags:
36    - mcelogs
37
38 - name: enable mcelog plugin
39   template:
40     src: mcelog.conf.j2
41     dest: "{{ config_file_dir }}/mcelog.conf"
42   when: mcelog_running|succeeded and mcelog_exists|succeeded and mcelog_client_exists|succeeded
43   tags:
44     - mcelogs