Fatih Degirmenci | 9d6f122 | 2020-03-15 22:28:54 +0000 | [diff] [blame^] | 1 | --- |
| 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2019 The Nordix Foundation. All rights reserved. |
| 4 | # ================================================================================ |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | # SPDX-License-Identifier: Apache-2.0 |
| 18 | # ============LICENSE_END========================================================= |
| 19 | |
| 20 | - name: Kill existing virtualbmc processes |
| 21 | command: killall -w vbmcd |
| 22 | args: |
| 23 | removes: "{{ ansible_env.HOME }}/.vbmc/master.pid" |
| 24 | ignore_errors: true |
| 25 | |
| 26 | - name: Stop existing vbmcd service |
| 27 | systemd: |
| 28 | name: vbmcd |
| 29 | enabled: false |
| 30 | state: stopped |
| 31 | ignore_errors: true |
| 32 | |
| 33 | - name: Remove outdated virtualbmc folder |
| 34 | file: |
| 35 | path: "{{ ansible_env.HOME }}/.vbmc/" |
| 36 | state: absent |
| 37 | |
| 38 | - name: Ensure virtualbmc systemd service is configured |
| 39 | template: |
| 40 | src: vbmcd.service.j2 |
| 41 | dest: /etc/systemd/system/vbmcd.service |
| 42 | owner: root |
| 43 | group: root |
| 44 | mode: 0644 |
| 45 | force: true |
| 46 | |
| 47 | - name: Ensure virtualbmc systemd service is started and enabled |
| 48 | systemd: |
| 49 | name: vbmcd |
| 50 | enabled: true |
| 51 | state: restarted |
| 52 | |
| 53 | - name: Create virtualbmc folder |
| 54 | file: |
| 55 | path: "{{ ansible_env.HOME }}/.vbmc/" |
| 56 | state: directory |
| 57 | |
| 58 | - name: Create vbmc configuration |
| 59 | template: |
| 60 | src: virtualbmc.conf.j2 |
| 61 | dest: "{{ ansible_env.HOME }}/.vbmc/virtualbmc.conf" |
| 62 | |
| 63 | # vim: set ts=2 sw=2 expandtab: |