Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
**/__pycache__/
.ansible/*
.venv/*
*.gz.b64
*.tar.gz
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ repos:
language: system
files: ^scenarios/sno-nxsw/poap\.py$
pass_filenames: false
- id: networking-lab-poap-md5sums
name: Format networking-lab POAP scripts with md5sum management
entry: scenarios/networking-lab/manage-poap-md5sums.sh
language: system
files: ^scenarios/networking-lab/.*-poap\.py$
pass_filenames: false

- repo: https://github.com/ansible/ansible-lint
rev: v6.22.2
Expand Down
37 changes: 37 additions & 0 deletions 03-redfish_vbmc_podman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# 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.

- name: Install RedFish Virtual BMC (Podman)
hosts: localhost
gather_facts: true
strategy: linear
pre_tasks:
- name: Load stack output vars from file
ansible.builtin.include_vars:
file: "{{ hotstack_work_dir | default(playbook_dir) }}/{{ stack_name }}-outputs.yaml"
name: stack_outputs

- name: Add controller-0 to the Ansible inventory
ansible.builtin.add_host: "{{ stack_outputs.controller_ansible_host }}"

roles:
- role: redfish_vbmc_podman
when:
- stack_outputs.sushy_emulator_uuids | default({}) | length > 0
delegate_to: controller-0
vars:
redfish_vbmc_podman_instances_uuids: "{{ stack_outputs.sushy_emulator_uuids.values() }}"
redfish_vbmc_podman_os_cloud: default
35 changes: 35 additions & 0 deletions 04-install_devstack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# 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.

- name: Install Devstack
hosts: localhost
gather_facts: true
strategy: linear
pre_tasks:
- name: Load stack output vars from file
ansible.builtin.include_vars:
file: "{{ hotstack_work_dir | default(playbook_dir) }}/{{ stack_name }}-outputs.yaml"
name: stack_outputs

- name: Add controller-0 to the Ansible inventory
ansible.builtin.add_host: "{{ stack_outputs.controller_ansible_host }}"

roles:
- role: devstack_installer
vars:
devstack_ansible_host: "{{ stack_outputs.devstack_ansible_host }}"
devstack_netplan_config: "{{ stack_outputs.devstack_netplan_config }}"
devstack_genericswitch_config: "{{ stack_outputs.genericswitch_config | default('') }}"
39 changes: 39 additions & 0 deletions 05-hotloop-stages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# 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.

- name: Run HotLoop Stages
hosts: localhost
gather_facts: true
strategy: linear
pre_tasks:
- name: Load stack output vars from file
ansible.builtin.include_vars:
file: "{{ hotstack_work_dir | default(playbook_dir) }}/{{ stack_name }}-outputs.yaml"
name: stack_outputs

- name: Add controller-0 to the Ansible inventory
ansible.builtin.add_host: "{{ stack_outputs.controller_ansible_host }}"

- name: "Load automation vars - store in variable: automation"
ansible.builtin.include_vars:
file: "{{ automation_vars_file }}"
name: automation

roles:
- role: hotloop
delegate_to: controller-0
vars:
work_dir: "{{ scenario_dir }}/{{ scenario }}"
30 changes: 30 additions & 0 deletions bootstrap_devstack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# 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.

- name: Bootstrap virtual infrastructure on Openstack cloud
ansible.builtin.import_playbook: 01-infra.yml

- name: Bootstrap controller node
ansible.builtin.import_playbook: 02-bootstrap_controller.yml

- name: Deploy RedFish Virtual BMC (Podman)
ansible.builtin.import_playbook: 03-redfish_vbmc_podman.yml

- name: Install DevStack
ansible.builtin.import_playbook: 04-install_devstack.yml

- name: Run HotLoop Stages
ansible.builtin.import_playbook: 05-hotloop-stages.yml
1 change: 1 addition & 0 deletions roles/controller/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ bin_dir: "{{ base_dir }}/bin"
ssh_key_dir: "{{ base_dir }}/.ssh"
data_dir: "{{ base_dir }}/data"
cloud_config_dir: "{{ base_dir }}/.hotcloud"
controller_install_openstack_client: false
hotstack_cloud_secrets:
auth_url: http://cloud.example.com:5000
application_credential_id: app_credential_id
Expand Down
36 changes: 36 additions & 0 deletions roles/controller/tasks/install_openstack_client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# 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.

- name: Create virtualenv for OpenStack client
become: true
ansible.builtin.pip:
name:
- python-openstackclient
- python-ironicclient
- python-heatclient
virtualenv: /opt/openstackclient-venv
virtualenv_command: python3 -m venv

- name: Create wrapper script in /usr/local/bin
become: true
ansible.builtin.copy:
content: |
#!/bin/bash
exec /opt/openstackclient-venv/bin/openstack "$@"
dest: /usr/local/bin/openstack
mode: '0755'
owner: root
group: root
4 changes: 4 additions & 0 deletions roles/controller/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,7 @@
[data_dir, 'ironic_nodes.yaml']
| ansible.builtin.path_join
}}

- name: Install OpenStack client
when: controller_install_openstack_client | bool
ansible.builtin.include_tasks: install_openstack_client.yml
Loading