Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 resolves #523
rajeshP524 committed Dec 22, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent e05bed9 commit e93bd60
Showing 4 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common.yml
Original file line number Diff line number Diff line change
@@ -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

14 changes: 14 additions & 0 deletions composable_prepare_nic_configs.yml
Original file line number Diff line number Diff line change
@@ -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]] }}"
27 changes: 27 additions & 0 deletions tasks/load_ocpinventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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: "{{ ocpinventory_content }}"
vars:
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
@@ -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

0 comments on commit e93bd60

Please sign in to comment.