Skip to content

Commit 23041d2

Browse files
committed
WIP: Add networking-lab with devstack-nxsw-vxlan
Introduces a new networking-lab directory for network-focused scenarios that don't require full OpenShift deployments. Includes first scenario: devstack-nxsw-vxlan with spine-and-leaf topology featuring: - 4 Cisco NX-OS switches (2 spine + 2 leaf) with OSPF underlay - Devstack node with trunk port for VLAN-tagged traffic - 2 Ironic baremetal nodes attached to leaf switches - Individual POAP scripts and configs per switch - VXLAN/EVPN ready configuration - SVG topology diagram - Automated POAP md5sum management script and pre-commit hook Point-to-point links consolidated in 10.1.1.0/24 to preserve 10.1.2.0/24+ address space for future use. Signed-off-by: Harald Jensås <hjensas@redhat.com>
1 parent 8e5b1fd commit 23041d2

31 files changed

Lines changed: 4896 additions & 0 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
**/__pycache__/
22
.ansible/*
33
.venv/*
4+
*.gz.b64
5+
*.tar.gz

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ repos:
5757
language: system
5858
files: ^scenarios/sno-nxsw/poap\.py$
5959
pass_filenames: false
60+
- id: networking-lab-poap-md5sums
61+
name: Format networking-lab POAP scripts with md5sum management
62+
entry: scenarios/networking-lab/manage-poap-md5sums.sh
63+
language: system
64+
files: ^scenarios/networking-lab/.*-poap\.py$
65+
pass_filenames: false
6066

6167
- repo: https://github.com/ansible/ansible-lint
6268
rev: v6.22.2

03-redfish_vbmc_podman.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
# Copyright Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
- name: Install RedFish Virtual BMC (Podman)
18+
hosts: localhost
19+
gather_facts: true
20+
strategy: linear
21+
pre_tasks:
22+
- name: Load stack output vars from file
23+
ansible.builtin.include_vars:
24+
file: "{{ hotstack_work_dir | default(playbook_dir) }}/{{ stack_name }}-outputs.yaml"
25+
name: stack_outputs
26+
27+
- name: Add controller-0 to the Ansible inventory
28+
ansible.builtin.add_host: "{{ stack_outputs.controller_ansible_host }}"
29+
30+
roles:
31+
- role: redfish_vbmc_podman
32+
when:
33+
- stack_outputs.sushy_emulator_uuids | default({}) | length > 0
34+
delegate_to: controller-0
35+
vars:
36+
redfish_vbmc_podman_instances_uuids: "{{ stack_outputs.sushy_emulator_uuids.values() }}"
37+
redfish_vbmc_podman_os_cloud: default

04-install_devstack.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
# Copyright Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
- name: Install Devstack
18+
hosts: localhost
19+
gather_facts: true
20+
strategy: linear
21+
pre_tasks:
22+
- name: Load stack output vars from file
23+
ansible.builtin.include_vars:
24+
file: "{{ hotstack_work_dir | default(playbook_dir) }}/{{ stack_name }}-outputs.yaml"
25+
name: stack_outputs
26+
27+
- name: Add controller-0 to the Ansible inventory
28+
ansible.builtin.add_host: "{{ stack_outputs.controller_ansible_host }}"
29+
30+
roles:
31+
- role: devstack_installer
32+
vars:
33+
devstack_ansible_host: "{{ stack_outputs.devstack_ansible_host }}"
34+
devstack_netplan_config: "{{ stack_outputs.devstack_netplan_config }}"
35+
devstack_genericswitch_config: "{{ stack_outputs.genericswitch_config | default('') }}"

05-hotloop-stages.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
# Copyright Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
- name: Run HotLoop Stages
18+
hosts: localhost
19+
gather_facts: true
20+
strategy: linear
21+
pre_tasks:
22+
- name: Load stack output vars from file
23+
ansible.builtin.include_vars:
24+
file: "{{ hotstack_work_dir | default(playbook_dir) }}/{{ stack_name }}-outputs.yaml"
25+
name: stack_outputs
26+
27+
- name: Add controller-0 to the Ansible inventory
28+
ansible.builtin.add_host: "{{ stack_outputs.controller_ansible_host }}"
29+
30+
- name: "Load automation vars - store in variable: automation"
31+
ansible.builtin.include_vars:
32+
file: "{{ automation_vars_file }}"
33+
name: automation
34+
35+
roles:
36+
- role: hotloop
37+
delegate_to: controller-0
38+
vars:
39+
work_dir: "{{ scenario_dir }}/{{ scenario }}"

bootstrap_devstack.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
# Copyright Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
- name: Bootstrap virtual infrastructure on Openstack cloud
18+
ansible.builtin.import_playbook: 01-infra.yml
19+
20+
- name: Bootstrap controller node
21+
ansible.builtin.import_playbook: 02-bootstrap_controller.yml
22+
23+
- name: Deploy RedFish Virtual BMC (Podman)
24+
ansible.builtin.import_playbook: 03-redfish_vbmc_podman.yml
25+
26+
- name: Install DevStack
27+
ansible.builtin.import_playbook: 04-install_devstack.yml
28+
29+
- name: Run HotLoop Stages
30+
ansible.builtin.import_playbook: 05-hotloop-stages.yml

roles/controller/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ bin_dir: "{{ base_dir }}/bin"
66
ssh_key_dir: "{{ base_dir }}/.ssh"
77
data_dir: "{{ base_dir }}/data"
88
cloud_config_dir: "{{ base_dir }}/.hotcloud"
9+
controller_install_openstack_client: false
910
hotstack_cloud_secrets:
1011
auth_url: http://cloud.example.com:5000
1112
application_credential_id: app_credential_id
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
# Copyright Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
- name: Create virtualenv for OpenStack client
18+
become: true
19+
ansible.builtin.pip:
20+
name:
21+
- python-openstackclient
22+
- python-ironicclient
23+
- python-heatclient
24+
virtualenv: /opt/openstackclient-venv
25+
virtualenv_command: python3 -m venv
26+
27+
- name: Create wrapper script in /usr/local/bin
28+
become: true
29+
ansible.builtin.copy:
30+
content: |
31+
#!/bin/bash
32+
exec /opt/openstackclient-venv/bin/openstack "$@"
33+
dest: /usr/local/bin/openstack
34+
mode: '0755'
35+
owner: root
36+
group: root

roles/controller/tasks/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,7 @@
192192
[data_dir, 'ironic_nodes.yaml']
193193
| ansible.builtin.path_join
194194
}}
195+
196+
- name: Install OpenStack client
197+
when: controller_install_openstack_client | bool
198+
ansible.builtin.include_tasks: install_openstack_client.yml

0 commit comments

Comments
 (0)