Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the hardware type 'r640' that belongs to different racks #528

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
30 changes: 30 additions & 0 deletions tasks/load_ocpinventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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: load ocpinventory data
slurp:
src: "{{ ocpinventory_file }}"
register: ocpinventory_data

- name: read ocpinventory file
set_fact:
ocpinventory_content: "{{ ocpinventory_data['content'] | b64decode | 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
sanjaychari marked this conversation as resolved.
Show resolved Hide resolved
networks:
- network: ctlplane
Expand Down