Ansible playbooks for provisioning a Custom OS server (RAM OS) and installing a customized OS on the BMC server. Choose whether to set up RAID 0 or 1, the root disk size, LVM, and the OS.
Bare Metal Cloud • Ansible Galaxy • Developers Portal • Knowledge Base • Support
- Bare Metal Cloud account
- Ansible 2.9+
- Python 2 (version 2.7) or Python 3 (versions 3.5 and higher)
- Python requests package
- Go to the Bare Metal Cloud signup page.
- Follow the prompts to set up your account.
- Use your credentials to log in to Bare Metal Cloud portal.
Follow these helpful tutorials to learn how to install Ansible on Ubuntu and Windows machines.
- How to Install and Configure Ansible on Ubuntu 20.04
- How to Install and Configure Ansible on Windows
This Ansible collection contains the server module which requires the Python requests HTTP library to work properly. If you don't have it installed on your machine already, run this command to install it:
pip install requests
Now install the Ansible collection by running:
ansible-galaxy collection install phoenixnap.bmc
You can view the server module documentation with this command:
ansible-doc phoenixnap.bmc.server
You need to create a configuration file called config.yaml
and save it in the user home directory. This file is used to authenticate access to your Bare Metal Cloud resources.
In your home directory, create a folder .pnap
and a config.yaml
file inside it.
This file needs to contain only two lines of code:
clientId: <enter your client id>
clientSecret: <enter your client secret>
To get the values for the clientId and clientSecret, follow these steps:
- Log in to the Bare Metal Cloud portal.
- On the left side menu, click on API Credentials.
- Click the Create Credentials button.
- Fill in the Name and Description fields, select the permissions scope and click Create.
- In the table, click on Actions and select View Credentials from the dropdown.
- Copy the values from the Client ID and Client Secret fields into your
config.yaml
file.
The Ansible Playbook allows you to provision and install a custom OS on a Bare Metal Cloud server.
- inventory.yaml contains all the information about the BMC server. Custom values in this file allows custom OS setup.
- provision.yaml deploys the BMC server using the RAM OS feature. The playbook uses the information from inventory.yaml to deploy and set up custom OS on the server.
This example shows you how to deploy and install:
- An s2.c1.medium server in Phoenix at an hourly rate.
- Rocky OS with a 50G root volume, LVM, and RAID level 0.
To run the example, use:
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook provision.yaml -i inventory.yaml
For the full guide, check out this helpful tutorial: How to Install Custom OS (Rocky Linux) On BMC
Become part of the Bare Metal Cloud community to get updates on new features, help us improve the platform, and engage with developers and other users.
- Follow @phoenixNAP on Twitter
- Join the official Slack channel
- Sign up for our Developers Monthly newsletter
Get in touch with us if you have questions or need help with Bare Metal Cloud.