-
Notifications
You must be signed in to change notification settings - Fork 23
Skc baremetal environment #2023
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
Draft
claudia-lola
wants to merge
34
commits into
stackhpc/2025.1
Choose a base branch
from
skc-baremetal-environment
base: stackhpc/2025.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,750
−106
Draft
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
3eeadec
Initial skc baremetal commit
assumptionsandg f190830
ansible directory and playbooks added to
claudia-lola 4725d97
created stackhpc-sushy-baremetal environment
claudia-lola 6f7e510
Add baremetal config
assumptionsandg ea55fc3
editing playbooks and config
a7df156
config edits
claudia-lola 02e6321
edit to controllers.yml
claudia-lola cb543de
lvm config
claudia-lola bb16a3e
config edits
claudia-lola 7b62965
config edits
claudia-lola d89cc63
Merge branch 'skc-baremetal-environment' of github.com:stackhpc/stack…
claudia-lola 8071839
edits baremetal 2 script in stackhpc-baremetal env
9ced382
playbook and xml file edits
0e41ba3
config changes
b0bc901
Merge branch 'stackhpc/2025.1' into skc-baremetal-environment
claudia-lola f83cfa4
added auto-setup playbook for sushy env, edits for baremetal env play…
claudia-lola 6b51b00
Merge branch 'skc-baremetal-environment' of https://github.com/stackh…
claudia-lola a437836
removed commented out tasks
claudia-lola 1292989
removing github workflows
claudia-lola aa6eb8b
moved vars from ironic.yml to be in group_vars and applied during enr…
claudia-lola f9521be
changed playbook name in baremetal-all to match new baremetal-0-enrol…
claudia-lola 4c34c01
added driver-info, new line for sushy ironic, format fixed for bareme…
claudia-lola a26287a
edits to driver-info, fix typo in baremetal-0
claudia-lola 6081923
fix typo in baremetal-0
claudia-lola f181700
removed bikolla_enable_secureboot
claudia-lola 169ac90
removed ironic_driver_info
claudia-lola 1dc4ed8
fix indentation
claudia-lola 2320e84
edits to baremetal scripts and ironic.yml
claudia-lola b71a267
changed ironic_redfish_address var
claudia-lola 2cfaf7b
change to ironic redfish address url
claudia-lola 895022b
deleted setup-local-link-information.yml playbook
claudia-lola 200d6f6
split sushy playbook in two, added tasks to create baremetal playbook…
claudia-lola d450861
edits to create-virtual-baremetal playbook
claudia-lola 870672e
edits to libvirt_vm creation
claudia-lola File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| #todo |
101 changes: 101 additions & 0 deletions
101
etc/kayobe/environments/stackhpc-baremetal/ansible/baremetal-0-enroll-baremetal.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| --- | ||
|
|
||
| - name: Register baremetal compute nodes | ||
| hosts: "{{ groups['controllers'][0] }}" | ||
| vars: | ||
| venv: "{{ virtualenv_path }}/openstack-cli" | ||
| tasks: | ||
| - name: Set up openstack cli virtualenv | ||
| pip: | ||
| virtualenv: "{{ venv }}" | ||
| name: | ||
| - python-openstackclient | ||
| - python-ironicclient | ||
| state: latest | ||
| virtualenv_command: "python3.{{ ansible_facts.python.version.minor }} -m venv" | ||
| extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}" | ||
|
|
||
| - name: Ensure baremetal nodes are registered in ironic | ||
| hosts: baremetal | ||
| gather_facts: false | ||
| max_fail_percentage: >- | ||
| {{ baremetal_compute_register_max_fail_percentage | | ||
| default(baremetal_compute_max_fail_percentage) | | ||
| default(kayobe_max_fail_percentage) | | ||
| default(100) }} | ||
| tags: | ||
| - baremetal | ||
| vars: | ||
| venv: "{{ virtualenv_path }}/openstack-cli" | ||
| #todo: extract this as a variable | ||
| controller_host: "{{ groups['controllers'][0] }}" | ||
| tasks: | ||
| - name: Check Ironic variables are defined | ||
| ansible.builtin.assert: | ||
| that: | ||
| - ironic_driver is defined | ||
| - ironic_driver_info is defined | ||
| - ironic_properties is defined | ||
| - ironic_resource_class is defined | ||
| fail_msg: One or more Ironic variables are undefined. | ||
|
|
||
| - block: | ||
| - name: Show baremetal node | ||
| ansible.builtin.command: | ||
| cmd: "{{ venv }}/bin/openstack baremetal node show {{ inventory_hostname }}" | ||
| register: node_show | ||
| failed_when: | ||
| - '"HTTP 404" not in node_show.stderr' | ||
| - node_show.rc != 0 | ||
| changed_when: false | ||
|
|
||
| # NOTE: The openstack.cloud.baremetal_node module cannot be used in this | ||
| # script due to requiring a MAC address pre-defined, instead, this should | ||
| # be discovered by inpsection following this script. | ||
| # | ||
| # NOTE: IPMI address must be passed with Redfish address to ensure existing | ||
| # Ironic nodes match with new nodes during inspection. | ||
| - name: Create baremetal nodes | ||
| ansible.builtin.shell: | ||
| cmd: | | ||
| {{ venv }}/bin/openstack baremetal node create \ | ||
| --name {{ inventory_hostname }} \ | ||
| --driver {{ ironic_driver }} \ | ||
| --driver-info redfish_system_id={{ ironic_redfish_system_id }} \ | ||
| --driver-info redfish_address={{ ironic_redfish_address }} \ | ||
| --driver-info redfish_username={{ ironic_redfish_username }} \ | ||
| --driver-info redfish_password={{ ironic_redfish_password }} \ | ||
claudia-lola marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| --driver-info redfish_verify_ca={{ ironic_redfish_verify_ca }} \ | ||
| {% for key, value in ironic_properties.items() %} | ||
| --property {{ key }}={{ value }} \ | ||
| {% endfor %} | ||
| --resource-class {{ ironic_resource_class }} | ||
| {% if ironic_boot_interface %} | ||
| --boot-interface {{ ironic_boot_interface }} | ||
| {% endif %} | ||
| {% if ironic_inspect_interface %} | ||
| --inspect-interface {{ ironic_inspect_interface }} | ||
| {% endif %} | ||
| {% if ironic_management_interface %} | ||
| --management-interface {{ ironic_management_interface }} | ||
| {% endif %} | ||
| {% if ironic_network_interface %} | ||
| --network-interface {{ ironic_network_interface }} | ||
| {% endif %} | ||
| {% if ironic_raid_interface %} | ||
| --raid-interface {{ ironic_raid_interface }} | ||
| {% endif %} | ||
| when: | ||
| - node_show.rc != 0 | ||
|
|
||
| - name: Manage baremetal nodes | ||
| ansible.builtin.command: | ||
| cmd: "{{ venv }}/bin/openstack baremetal node manage {{ inventory_hostname }} --wait" | ||
| when: | ||
| - node_show.rc != 0 | ||
| delegate_to: "{{ controller_host }}" | ||
| vars: | ||
| # NOTE: Without this, the controller's ansible_host variable will not | ||
| # be respected when using delegate_to. | ||
| ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}" | ||
| environment: "{{ openstack_auth_env }}" | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.