X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=roles%2Fbaremetal_provision%2Ftasks%2Fvbmc_port_setup.yml;fp=roles%2Fbaremetal_provision%2Ftasks%2Fvbmc_port_setup.yml;h=7061aa388b7c033cb2195e5dc89985d01d6ffa7f;hb=74a49ba6ef2ea715fa492db0bcd85c30398688e8;hp=0000000000000000000000000000000000000000;hpb=a936af362724cca0c5dc2c424902d398f9833410;p=ta%2Finfra-ansible.git diff --git a/roles/baremetal_provision/tasks/vbmc_port_setup.yml b/roles/baremetal_provision/tasks/vbmc_port_setup.yml new file mode 100644 index 0000000..7061aa3 --- /dev/null +++ b/roles/baremetal_provision/tasks/vbmc_port_setup.yml @@ -0,0 +1,42 @@ +--- + +# Copyright 2019 Nokia + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: Create a directory for virtualbmc.conf + file: + path: "/etc/virtualbmc/" + state: directory + mode: 0755 + +- name: Copy in virtualbmc.conf file + copy: + src: "virtualbmc.conf" + dest: "/etc/virtualbmc/" + +- name: Create vbmc nodes + command: /usr/bin/vbmc add {{ item.name }} --libvirt-uri "qemu+ssh://root@{{item.driver_info['power']['ssh_address'] | ipwrap}}/system?no_verify=1" --port {{ item.driver_info['power']['ipmi_port'] }} + become: True + become_flags: '-H' + register: vbmc_out + with_items: "{{ baremetal_ironic_nodes }}" + failed_when: "vbmc_out.rc != 0 and 'already exists' not in vbmc_out.stderr" + loop_control: + label: "{{ item.name }}" + +- name: Start vbmc node ports + command: sudo /usr/bin/vbmc start {{ item.name }} + with_items: "{{ baremetal_ironic_nodes }}" + loop_control: + label: "{{ item.name }}"