### Install Bifrost with bifrost-cli (Example) Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst An example of installing Bifrost using bifrost-cli, specifying the network interface 'eno1' and a DHCP pool. This demonstrates practical usage of the command. ```bash ./bifrost-cli install --network-interface eno1 \ --dhcp-pool 10.0.0.20-10.0.0.100 ``` -------------------------------- ### Install Bifrost with bifrost-cli (Basic) Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Installs the Bare Metal service using bifrost-cli with specified network interface and DHCP pool. This is a quick start method for Bifrost installation. ```bash ./bifrost-cli install \ --network-interface \ --dhcp-pool - ``` -------------------------------- ### Example Bifrost Installation Playbook Source: https://github.com/openstack/bifrost/blob/master/playbooks/roles/bifrost-ironic-install/README.md An example Ansible playbook demonstrating how to install Bifrost locally, specifying the role and network interface. ```yaml - hosts: localhost connection: local name: "Install ironic locally" become: yes gather_facts: yes roles: - role: bifrost-ironic-install testing: true network_interface: "virbr0" ``` -------------------------------- ### Bifrost CLI Install Help Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Displays the help information for the 'bifrost-cli install' command, providing details on all available parameters and options. ```bash ./bifrost-cli install --help ``` -------------------------------- ### Install Python and Git on openSUSE Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Installs the necessary Python 3 and Git packages on openSUSE systems using the zipper package manager. ```bash sudo zipper install -y python3 git ``` -------------------------------- ### Example Bifrost Keystone Install Playbook Source: https://github.com/openstack/bifrost/blob/master/playbooks/roles/bifrost-keystone-install/README.md An example Ansible playbook demonstrating how to use the bifrost-keystone-install role, followed by the bifrost-ironic-install role. It highlights the recommended order of execution for proper variable utilization. ```ansible - hosts: localhost connection: local name: "Install ironic locally" become: yes gather_facts: yes roles: - role: bifrost-keystone-install - role: bifrost-ironic-install ``` -------------------------------- ### Bifrost Offline URL Configuration (YAML) Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/offline-install.rst Example YAML configuration for redirecting Bifrost's upstream URLs to local file paths for offline installation. This includes kernel, initramfs, disk images, and Git repository locations. ```yaml ipa_kernel_upstream_url: file:///vagrant/ipa-centos9-master.kernel ipa_ramdisk_upstream_url: file:///vagrant/ipa-centos9-master.initramfs custom_deploy_image_upstream_url: file:///vagrant/cirros-0.5.3-x86_64-disk.img dib_git_url: file:///vagrant/git/diskimage-builder ironicclient_git_url: file:///vagrant/git/python-ironicclient ironic_git_url: file:///vagrant/git/ironic ``` -------------------------------- ### Ansible Playbook Example for Bifrost Installation Source: https://github.com/openstack/bifrost/blob/master/playbooks/roles/bifrost-prep-for-install/README.md This example demonstrates how to use the bifrost-prep-for-install role within an Ansible playbook to set up the Bifrost environment. It includes conditional execution based on a 'skip_install' variable and also shows the inclusion of another role, 'bifrost-ironic-install'. ```yaml - hosts: localhost connection: local name: "Install Ironic" become: yes gather_facts: yes roles: - role: bifrost-prep-for-install when: not (skip_install | default(false) | bool) - role: bifrost-ironic-install testing: true ``` -------------------------------- ### Clone Bifrost Project Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Clones the Bifrost project from its OpenDev repository and navigates into the project directory. This is the initial step for setting up Bifrost. ```bash git clone https://opendev.org/openstack/bifrost cd bifrost ``` -------------------------------- ### Start Bifrost VM with Vagrant Source: https://github.com/openstack/bifrost/blob/master/doc/source/contributor/vagrant.rst Starts an Ubuntu-based virtual machine with Bifrost installed using Vagrant. This process can take a significant amount of time, especially on the first run. ```bash cd tools/vagrant_dev_env vagrant up ``` -------------------------------- ### Install Python and Git on Ubuntu/Debian Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Installs the necessary Python 3 and Git packages on Ubuntu or Debian systems using the apt package manager. ```bash sudo apt-get update sudo apt-get install -y python3 git ``` -------------------------------- ### Install Python and Git on CentOS/RHEL/Fedora Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Installs the necessary Python 3 and Git packages on CentOS, RHEL, or Fedora systems using the dnf package manager. ```bash sudo dnf install -y git python3 ``` -------------------------------- ### Test Bifrost Environment with bifrost-cli Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Prepares a testing environment for Bifrost using the bifrost-cli tool. This is useful for testing on virtual machines. ```bash ./bifrost-cli testenv ``` -------------------------------- ### View All DNF Repositories Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Displays the status of all DNF repositories, including whether they are enabled or disabled, to help verify the 'extras' and 'optional' repositories. ```bash sudo dnf repolist all | grep 'optional|extras' ``` -------------------------------- ### Install Bifrost in Test Environment Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Installs Bifrost in a test environment using the '--testenv' flag with bifrost-cli. This is used when installing on virtual machines. ```bash ./bifrost-cli install --testenv ``` -------------------------------- ### Checkout Bifrost Stable Branch Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Checks out a specific stable branch of the Bifrost project, allowing installation from a particular release series. For example, 'stable/2025.1'. ```bash git checkout stable/2025.1 ``` -------------------------------- ### Environment Setup and Virtual Environment Activation Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/playbooks.rst Executes the env-setup.sh script to install dependencies and create a virtual environment, followed by activating the environment. This is a prerequisite for running Ansible playbooks. ```bash bash ./scripts/env-setup.sh source /opt/stack/bifrost/bin/activate cd playbooks ``` -------------------------------- ### Enable RHEL Server Repositories Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Enables optional and extras repositories for RHEL servers using dnf config-manager. These commands are used to enable specific software sources for the system. ```bash sudo dnf config-manager --enable rhui-REGION-rhel-server-optional sudo dnf config-manager --enable rhui-REGION-rhel-server-extras ``` -------------------------------- ### Bifrost CI Environment Setup Source: https://github.com/openstack/bifrost/blob/master/scripts/README.md Script used to install initial dependencies for Bifrost CI testing. Intended for use within the OpenStack CI environment. ```bash #!/bin/bash # This is a placeholder for the actual env-setup.sh script content. # It would typically contain commands to install packages, set up virtual environments, # and configure the necessary tools for Bifrost testing. echo "Setting up Bifrost CI environment..." # ... dependency installation commands here ... echo "Bifrost environment setup complete." ``` -------------------------------- ### Example Bifrost Playbook Source: https://github.com/openstack/bifrost/blob/master/playbooks/roles/bifrost-create-vm-nodes/README.md An example Ansible playbook demonstrating the usage of the bifrost-create-vm-nodes role. ```yaml - hosts: localhost connection: local become: yes gather_facts: yes roles: - role: bifrost-create-vm-nodes ``` -------------------------------- ### Check DNF Repositories Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Checks if the 'extras' and 'optional' DNF repositories are enabled on RHEL-based systems, which are required for Bifrost dependencies. ```bash sudo dnf repolist | grep 'optional|extras' ``` -------------------------------- ### Build Custom IPA Images Configuration Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Configuration settings for building custom Ironic Python Agent (IPA) images using diskimage-builder and ironic-python-agent-builder. Requires setting 'download_ipa' to false and 'create_ipa_image' to true. ```APIDOC Build Custom Ironic Python Agent (IPA) images: To build a custom IPA ramdisk, the following settings must be configured: - download_ipa: Set to `false`. - create_ipa_image: Set to `true`. By default, the install playbook builds a Debian Bookworm based IPA image if no pre-existing IPA image is found. You can explicitly set a specific release. ``` -------------------------------- ### Ansible Playbook Execution (Basic) Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/playbooks.rst Executes the Ansible playbook for installation. Use -K to prompt for sudo password if passwordless sudo is not enabled. ```bash ansible-playbook -vvvv -i inventory/target install.yaml ``` ```bash ansible-playbook -K -vvvv -i inventory/target install.yaml ``` -------------------------------- ### Bifrost DHCP Configuration Guidance Source: https://github.com/openstack/bifrost/blob/master/playbooks/roles/bifrost-ironic-install/README.md Provides guidance for configuring external DHCP servers when Bifrost is in use, specifically for enabling PXE and iPXE chain loading. Refer to the separate documentation for detailed setup instructions. ```ansible # In the event of an external DHCP server being used, the user will need to # configure their DHCP server such that PXE, and iPXE chain loading occurs. # For additional information for setting up DHCP in this scenario refer to # the bifrost documentation file doc/source/deploy/dhcp.rst. ``` -------------------------------- ### Example Bifrost Deployment Playbook Source: https://github.com/openstack/bifrost/blob/master/playbooks/roles/bifrost-deploy-nodes-dynamic/README.md An example Ansible playbook demonstrating how to use the Bifrost roles for node deployment. ```ansible - hosts: baremetal connection: local become: no roles: - role: bifrost-configdrives-dynamic - role: bifrost-deploy-nodes-dynamic ``` -------------------------------- ### Generating Checksums for IPA Images (Console) Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/offline-install.rst Console commands to generate SHA256 checksum files for IPA kernel and initramfs images, required for offline installation with kolla-ansible. ```console sha256sum /vagrant/ipa-centos8-master.kernel > /vagrant/ipa-centos8-master.kernel.sha256 sha256sum /vagrant/ipa-centos8-master.initramfs > /vagrant/ipa-centos8-master.initramfs.sha256 ``` -------------------------------- ### Using Remote Ironic with Bifrost Source: https://github.com/openstack/bifrost/blob/master/doc/source/user/howto.rst This example demonstrates how to use Bifrost with a remote Ironic installation. It involves setting up an Ansible inventory with the target server and running the enroll-dynamic.yaml playbook after cleaning up example inventory files. ```bash export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.json cd playbooks rm inventory/*.example ansible-playbook -vvvv -i inventory/ enroll-dynamic.yaml ``` -------------------------------- ### OpenStack Bifrost Environment Setup Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/keystone.rst This snippet demonstrates how to source the `openrc` file generated after Bifrost installation with Keystone enabled. This allows the user to set up environment variables for interacting with OpenStack utilities, such as listing baremetal drivers. ```bash . ~/openrc bifrost openstack baremetal driver list ``` -------------------------------- ### Building Custom IPA Image with diskimage-builder Source: https://github.com/openstack/bifrost/blob/master/doc/source/user/troubleshooting.rst Example commands for building a custom IPA image using `diskimage-builder` (DIB), including setting environment variables for user creation and SSH key authorization. ```bash export DIB_DEV_USER_USERNAME=customuser export DIB_DEV_USER_PWDLESS_SUDO=yes export DIB_DEV_USER_AUTHORIZED_KEYS=$HOME/.ssh/id_rsa.pub ironic-python-agent-builder -o /path/to/custom-ipa -e devuser debian ``` -------------------------------- ### Bifrost CLI Test Environment Setup Source: https://github.com/openstack/bifrost/blob/master/doc/source/contributor/testenv.rst Sets up a testing environment for Bifrost using the bifrost-cli. This command can take optional parameters like --develop, --driver, and --uefi to customize the environment. ```bash ./bifrost-cli testenv ./bifrost-cli testenv --help ``` -------------------------------- ### Deploy Hardware using bifrost-cli (Bash) Source: https://github.com/openstack/bifrost/blob/master/doc/source/user/howto.rst Command to deploy hardware using the `bifrost-cli` tool, specifying an inventory file and environment variables. ```bash ./bifrost-cli deploy /tmp/baremetal.json \ -e @baremetal-install-env.json ``` -------------------------------- ### Ansible Module Usage Example Source: https://github.com/openstack/bifrost/blob/master/CONTRIBUTING.rst Illustrates the recommended way to pass file paths to Ansible modules, favoring key-value pair lists on the command line over string key-value pairs. ```yaml - name: "Stat file for x reason" stat: file: '/path/to/file' ``` -------------------------------- ### Configure OpenStack Client for Bifrost Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Sets the OS_CLOUD environment variable to 'bifrost'. This directs the OpenStack client tools to use the Bifrost cloud configuration. ```shell export OS_CLOUD=bifrost ``` -------------------------------- ### Deploy Hosts with Bifrost and Environment Variables Source: https://github.com/openstack/bifrost/blob/master/doc/source/user/howto.rst This example shows how to deploy hosts using Bifrost, passing environment variables from a file. It sets BIFROST_INVENTORY_SOURCE, specifies an environment file using -e, and runs the deploy-dynamic.yaml playbook. ```bash export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.json cd playbooks ansible-playbook -vvvv \ -i inventory/bifrost_inventory.py \ -e @../baremetal-install-env.json \ deploy-dynamic.yaml ``` -------------------------------- ### Activate Bifrost Virtual Environment Source: https://github.com/openstack/bifrost/blob/master/doc/source/install/index.rst Activates the Python virtual environment for Bifrost. This is necessary when working within a virtual environment to ensure the correct dependencies are loaded. ```shell source ~/bifrost/env/bin/activate ``` -------------------------------- ### Bifrost Development Workflow with Git Source: https://github.com/openstack/bifrost/blob/master/CONTRIBUTING.rst This snippet demonstrates the basic Git commands for cloning the Bifrost repository, creating a new branch, making changes, committing, and submitting for review using `git review`. ```bash git clone https://opendev.org/openstack/bifrost cd bifrost git checkout -b some-branch-name # ... hack hack hack ... git commit git review ``` -------------------------------- ### Bifrost Default Variable Loading Order Source: https://github.com/openstack/bifrost/blob/master/playbooks/roles/bifrost-ironic-install/README.md Illustrates the hierarchical loading order of default variables in Bifrost, starting from generic OS families down to specific versions. This allows for targeted overrides and customization. ```ansible # For example, for Ubuntu 15.04, the role will attempt to import the following files: # # - required_defaults_Debian.yml # - required_defaults_Ubuntu.yml # - required_defaults_Ubuntu_15.04.yml # # Variables specified in the more specific files will be used to override # values in the more generic defaults files. ``` -------------------------------- ### Keystone Configuration Structure Source: https://github.com/openstack/bifrost/blob/master/playbooks/roles/bifrost-keystone-install/README.md Defines the nested data structure for Keystone configuration, including bootstrap, message queue, and database settings. This structure allows for explicit control over Keystone's setup and integration with Ironic. ```ansible keystone: debug: true bootstrap: enabled: true username: admin password: ChangeThisPa55w0rd project_name: admin admin_url: "http://127.0.0.1:5000/v3/" public_url: "http://127.0.0.1:5000/v3/" internal_url: "http://127.0.0.1:5000/v3/" region_name: "RegionOne" message_queue: username: keystone password: ChangeThisPa55w0rd host: 127.0.0.1 port: 5672 database: name: keystone username: keystone password: ChangeThisPa55w0rd host: 127.0.0.1 ``` -------------------------------- ### Inventory File: Basic Node Configuration (JSON) Source: https://github.com/openstack/bifrost/blob/master/doc/source/user/howto.rst Example of a JSON inventory file for provisioning a node. Includes driver, driver_info, nics, and properties. ```json { "testvm1": { "name": "testvm1", "driver": "ipmi", "driver_info": { "ipmi_address": "192.168.122.1", "ipmi_username": "admin", "ipmi_password": "pa$$w0rd" }, "nics": [ { "mac": "52:54:00:f9:32:f6" } ], "properties": { "cpu_arch": "x86_64", "root_device": {"wwn": "0x4000cca77fc4dba1"} } } } ``` -------------------------------- ### Example Bifrost Cloud Config Playbook Source: https://github.com/openstack/bifrost/blob/master/playbooks/roles/bifrost-cloud-config/README.md This snippet demonstrates how to include the `bifrost-cloud-config` role in an Ansible playbook. It specifies the `noauth_mode` variable, which controls whether bifrost is installed in no-authentication mode. The playbook runs locally and does not gather facts initially. ```yaml - hosts: localhost connection: local become: no gather_facts: no roles: - role: bifrost-cloud-config noauth_mode: false ``` -------------------------------- ### Deploy Hardware with File Image (Bash) Source: https://github.com/openstack/bifrost/blob/master/doc/source/user/howto.rst Command to deploy hardware using a custom image from a local file path. ```bash ./bifrost-cli deploy -e @baremetal-install-env.json \ --image file:///var/lib/ironic/custom-image.qcow2 ```