This Terraform configuration deploys a requested amount of Instances on an OpenStack cloud, to be used as a Multinode Kayobe test environment.
These instructions show how to use this Terraform configuration manually. They assume you are running an Ubuntu host that will be used to run Terraform. The machine should have network access to the environment that will be created by this configuration.
Install Terraform:
wget -qO - terraform.gpg https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/terraform-archive-keyring.gpg
sudo echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/terraform-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/terraform.list
sudo apt update
sudo apt install terraformClone and initialise the Kayobe config:
git clone https://github.com/stackhpc/terraform-kayobe-multinode
cd terraform-kayobe-multinodeInitialise Terraform:
terraform initGenerate an SSH keypair:
ssh-keygen -f id_rsa -N ''Create an OpenStack clouds.yaml file with your credentials to access an OpenStack cloud. Alternatively, download one from Horizon.
cat << EOF > clouds.yaml
---
clouds:
sms-lab:
auth:
auth_url: https://api.sms-lab.cloud:5000
username: <username>
project_name: <project>
domain_name: default
interface: public
EOFExport environment variables to use the correct cloud and provide a password:
export OS_CLOUD=sms-lab
read -p OS_PASSWORD -s OS_PASSWORD
export OS_PASSWORDGenerate Terraform variables:
cat << EOF > terraform.tfvars
ssh_private_key = "id_rsa"
ssh_public_key = "id_rsa.pub"
seed_vm_name = "kayobe-seed"
seed_vm_image = "CentOS-stream8"
multinode_keypair = "multinode_keypair"
seed_vm_flavor = "general.v1.tiny"
multinode_vm_network = "stackhpc-ipv4-geneve"
multinode_vm_subnet = "stackhpc-ipv4-geneve-subnet"
multinode_image = "CentOS-stream8"
multinode_flavor = "general.v1.tiny"
EOFGenerate a plan:
terraform planApply the changes:
terraform apply -auto-approveYou should have requested number of resources spawned on Openstack, and ansible_inventory file produced as output for Kayobe.