Skip to content

Commit

Permalink
Add support for the hardware type 'r640' that belongs to different racks
Browse files Browse the repository at this point in the history
This PR adds support for only OSP17
Partially addresses redhat-performance#523
  • Loading branch information
rajeshP524 committed Dec 22, 2022
1 parent e05bed9 commit 2ae7297
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
- name: load instackenv file
include_tasks: tasks/load_instackenv.yml

- name: load ocpinventory file
include_tasks: tasks/load_ocpinventory.yml

- name: get tn10rt machines list
shell: curl http://wiki.scalelab.redhat.com/1029u/ > ~/tn10rt.html

Expand Down
14 changes: 14 additions & 0 deletions composable_prepare_nic_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@
lab_vars: "{{ (lab_name == 'scale') | ternary(scale, alias) }}"
when: lab_name in ['scale', 'alias'] and osp_release|int >= 17

- name: generic interface names for r640
set_fact:
machine_ifaces: "{{ machine_ifaces | combine(update_item) }}"
vars:
update_item: "{ 'r640': {{ ['nic1', 'nic2', 'nic3', 'nic4'] }} }"
when: lab_name == "scale" and osp_release|int >= 17

- name: generic interface names for r640
set_fact:
machine_ifaces: "{{ machine_ifaces | combine(update_item) }}"
vars:
update_item: "{ 'r640': {{ ['nic2', 'nic1', 'nic3', 'nic4'] }} }"
when: lab_name == "alias" and osp_release|int >= 17

- name: set interfaces
set_fact:
ifaces: "{{ ifaces|default([]) + [ machine_ifaces[item]] }}"
Expand Down
25 changes: 25 additions & 0 deletions tasks/load_ocpinventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ocpinventory.json for MAC addresses
---
- name: Download ocpinventory.json
get_url:
url: "{{ alias.lab_url }}/cloud/{{ cloud_name }}_ocpinventory.json"
dest: ~/
mode: '0644'
force: yes
when: lab_name == "alias"

- name: Download ocpinventory.json
get_url:
url: "{{ scale.lab_url }}/cloud/{{ cloud_name }}_ocpinventory.json"
dest: ~/
mode: '0644'
force: yes
when: lab_name == "scale"

- name: set fact for ocpinventory file
set_fact:
ocpinventory_file: "~/{{ cloud_name }}_ocpinventory.json"

- name: read ocpinventory file
set_fact:
ocpinventory_content: "{{ lookup('file', '{{ ocpinventory_file }}') | from_json }}"
12 changes: 12 additions & 0 deletions templates/baremetal_deployment.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@
defaults:
profile: baremetal{{ node_type }}
network_config:
{# workaround for r640's that has different interface namings #}
{% if node_type|string() == "r640" %}
net_config_data_lookup:
{% for i in range(0, ocpinventory_content.nodes | length) %}
{% if node_type|string() in ocpinventory_content.nodes[i].pm_addr|string() %}
node{{ i|int + 1 }}:
{% for j in range(0, ocpinventory_content.nodes[i].mac | length) %}
nic{{ j|int + 1 }}: "{{ ocpinventory_content.nodes[i].mac[j] }}"
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
template: /home/stack/virt/network/vlans/compute_{{ node_type }}.j2
networks:
- network: ctlplane
Expand Down

0 comments on commit 2ae7297

Please sign in to comment.