Fatih Degirmenci | 50b146b | 2019-05-10 14:11:57 +0200 | [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 | - name: Gather data from PDF and IDF |
| 20 | set_fact: |
| 21 | num_nodes: "{{ nodes | length }}" |
| 22 | vms: "{{ idf[installer_type].hostnames }}" |
| 23 | networks: "{{ idf[installer_type].network }}" |
| 24 | |
| 25 | - include_tasks: create-libvirt-pool.yml |
| 26 | |
| 27 | - name: Stop existing virtualbmc processes |
| 28 | command: killall -w vbmc |
Fatih Degirmenci | df251d5 | 2019-12-11 13:43:10 +0100 | [diff] [blame] | 29 | args: |
| 30 | removes: "{{ ansible_env.HOME }}/.vbmc/master.pid" |
Fatih Degirmenci | f9cf549 | 2020-01-12 22:35:53 +0000 | [diff] [blame] | 31 | ignore_errors: true |
Fatih Degirmenci | 50b146b | 2019-05-10 14:11:57 +0200 | [diff] [blame] | 32 | |
| 33 | - name: Remove outdated virtualbmc folder |
| 34 | file: |
| 35 | path: "{{ ansible_env.HOME }}/.vbmc/" |
| 36 | state: absent |
| 37 | |
Vamsi Savaram | ce36801 | 2019-08-07 09:09:42 +0000 | [diff] [blame] | 38 | - name: Create virtualbmc folder |
| 39 | file: |
| 40 | path: "{{ ansible_env.HOME }}/.vbmc/" |
| 41 | state: directory |
| 42 | |
| 43 | - name: Create vbmc configuration |
| 44 | template: |
Fatih Degirmenci | f9cf549 | 2020-01-12 22:35:53 +0000 | [diff] [blame] | 45 | src: virtualbmc.conf.j2 |
Vamsi Savaram | ce36801 | 2019-08-07 09:09:42 +0000 | [diff] [blame] | 46 | dest: "{{ ansible_env.HOME }}/.vbmc/virtualbmc.conf" |
| 47 | |
Fatih Degirmenci | 50b146b | 2019-05-10 14:11:57 +0200 | [diff] [blame] | 48 | - include_tasks: create-libvirt-vms.yml |
| 49 | with_dict: "{{ vms }}" |
| 50 | loop_control: |
| 51 | loop_var: vm |
| 52 | |
| 53 | # vim: set ts=2 sw=2 expandtab: |