From c0a49c2779e408afe85ab44ff4b6ed1c843fa1f3 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Thu, 14 Feb 2019 12:26:13 +0100 Subject: Fix typo The name of the file should have baremetal not barematal Change-Id: I15d70b69943e8ce3032c76d1cd7bc7272a6b8d56 Signed-off-by: Manuel Buil --- .../create-nodes/tasks/barematalhoststojson.yml | 82 ---------------------- .../create-nodes/tasks/baremetalhoststojson.yml | 82 ++++++++++++++++++++++ xci/playbooks/roles/create-nodes/tasks/main.yml | 2 +- 3 files changed, 83 insertions(+), 83 deletions(-) delete mode 100644 xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml create mode 100644 xci/playbooks/roles/create-nodes/tasks/baremetalhoststojson.yml (limited to 'xci/playbooks/roles/create-nodes/tasks') diff --git a/xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml b/xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml deleted file mode 100644 index 8aeea321..00000000 --- a/xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -# Copyright 2018, SUSE Linux GmbH -# -# 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. - -# This playbook builds the json file with information about the baremetal nodes -# which is read by ironic to start the pxe booting - - -- name: BAREMETAL - Create file for static ip - file: - path: /tmp/baremetalstaticips - state: touch - group: root - owner: root - mode: 0644 - -- name: "Generating the json describing baremetal nodes" - block: - - - set_fact: - node_name: "{{ ('kubespray' in installer_type) | ternary(idf.kubespray.hostnames[item.name], idf.osa.hostnames[item.name]) }}" - - - set_fact: - host_group: "{{ node_default_groups }}" - - - set_fact: - host_group: "{{ node_default_groups | union(node_groups[node_name]) }}" - when: node_groups[node_name] is defined - - - name: BAREMETAL - Fetch the ip - set_fact: - admin_ip: "{{ item.interfaces[idf.net_config.admin.interface].address }}" - - - name: BAREMETAL - Fetch the mac - set_fact: - admin_mac: "{{ item.interfaces[idf.net_config.admin.interface].mac_address }}" - - - name: BAREMETAL - set the json entry for baremetal nodes - set_fact: - node_data: - name: "{{ node_name }}" - uuid: "{{ node_name | to_uuid }}" - host_groups: "{{ host_group }}" - driver: "ipmi" - driver_info: - power: - ipmi_address: "{{ item.remote_management.address }}" - ipmi_port: "{{ virtual_ipmi_port| default('623') }}" - ipmi_username: "{{ item.remote_management.user }}" - ipmi_password: "{{ item.remote_management.pass }}" - nics: - - mac: "{{ admin_mac }}" - ansible_ssh_host: "{{ admin_ip }}" - ipv4_address: "{{ admin_ip }}" - properties: - cpu_arch: "{{ item.node.arch }}" - ram: "{{ item.node.memory.rstrip('G') }}" - cpus: "{{ item.node.cpus }}" - disk_size: "{{ item.disks[0].disk_capacity.rstrip('G') }}" - - - name: BAREMETAL - Static ip config for dnsmasq - lineinfile: - path: /tmp/baremetalstaticips - state: present - line: '{{ admin_mac }},{{ admin_ip }}' - - - name: BAREMETAL - add created node info - set_fact: - nodes_json_data: "{{ nodes_json_data | combine({node_name: node_data}) }}" - - when: (num_nodes | int) > (nodes_json_data | length | int) + 1 diff --git a/xci/playbooks/roles/create-nodes/tasks/baremetalhoststojson.yml b/xci/playbooks/roles/create-nodes/tasks/baremetalhoststojson.yml new file mode 100644 index 00000000..8aeea321 --- /dev/null +++ b/xci/playbooks/roles/create-nodes/tasks/baremetalhoststojson.yml @@ -0,0 +1,82 @@ +--- +# Copyright 2018, SUSE Linux GmbH +# +# 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. + +# This playbook builds the json file with information about the baremetal nodes +# which is read by ironic to start the pxe booting + + +- name: BAREMETAL - Create file for static ip + file: + path: /tmp/baremetalstaticips + state: touch + group: root + owner: root + mode: 0644 + +- name: "Generating the json describing baremetal nodes" + block: + + - set_fact: + node_name: "{{ ('kubespray' in installer_type) | ternary(idf.kubespray.hostnames[item.name], idf.osa.hostnames[item.name]) }}" + + - set_fact: + host_group: "{{ node_default_groups }}" + + - set_fact: + host_group: "{{ node_default_groups | union(node_groups[node_name]) }}" + when: node_groups[node_name] is defined + + - name: BAREMETAL - Fetch the ip + set_fact: + admin_ip: "{{ item.interfaces[idf.net_config.admin.interface].address }}" + + - name: BAREMETAL - Fetch the mac + set_fact: + admin_mac: "{{ item.interfaces[idf.net_config.admin.interface].mac_address }}" + + - name: BAREMETAL - set the json entry for baremetal nodes + set_fact: + node_data: + name: "{{ node_name }}" + uuid: "{{ node_name | to_uuid }}" + host_groups: "{{ host_group }}" + driver: "ipmi" + driver_info: + power: + ipmi_address: "{{ item.remote_management.address }}" + ipmi_port: "{{ virtual_ipmi_port| default('623') }}" + ipmi_username: "{{ item.remote_management.user }}" + ipmi_password: "{{ item.remote_management.pass }}" + nics: + - mac: "{{ admin_mac }}" + ansible_ssh_host: "{{ admin_ip }}" + ipv4_address: "{{ admin_ip }}" + properties: + cpu_arch: "{{ item.node.arch }}" + ram: "{{ item.node.memory.rstrip('G') }}" + cpus: "{{ item.node.cpus }}" + disk_size: "{{ item.disks[0].disk_capacity.rstrip('G') }}" + + - name: BAREMETAL - Static ip config for dnsmasq + lineinfile: + path: /tmp/baremetalstaticips + state: present + line: '{{ admin_mac }},{{ admin_ip }}' + + - name: BAREMETAL - add created node info + set_fact: + nodes_json_data: "{{ nodes_json_data | combine({node_name: node_data}) }}" + + when: (num_nodes | int) > (nodes_json_data | length | int) + 1 diff --git a/xci/playbooks/roles/create-nodes/tasks/main.yml b/xci/playbooks/roles/create-nodes/tasks/main.yml index 8e54fcd1..607ac494 100644 --- a/xci/playbooks/roles/create-nodes/tasks/main.yml +++ b/xci/playbooks/roles/create-nodes/tasks/main.yml @@ -24,7 +24,7 @@ - include_tasks: create_vm.yml with_indexed_items: "{{ vms_to_create }}" -- include_tasks: barematalhoststojson.yml +- include_tasks: baremetalhoststojson.yml with_items: "{{ baremetal_nodes }}" - name: Start the opnfv vm -- cgit 1.2.3-korg