To install the terraform command in linux ubuntu I sent these commands to work in my virtual box machine:
terraform plan
sudo snap install terraform
sudo apt install terraform
sudo apt update && sudo apt install -y gnupg software-properties-common curl
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install -y terraform
Example Project with OpenStack: Video Tutorial
git clone https://github.com/hasanashik/openstack-terraform
cd openstack-terraform
terraform init
terraform plan
terraform validate
terraform apply
ERRORS:
terraform apply:
SOLUTION: Find the controller ip address:
openstack endpoint list
Got error: Missing value auth-url required for auth plugin password
solultion:
$ source /opt/stack/devstack/openrc admin admin
example Otuput:
+----------------------------------+-----------+--------------+----------------+---------+-----------+--------------------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+----------------+---------+-----------+--------------------------------------------+
| 0b84bd4867d344e1843c5670dd695c47 | RegionOne | glance | image | True | public | http://10.0.2.15/image |
| 6585ecd31c3747a891fed186e9d83e44 | RegionOne | nova | compute | True | public | http://10.0.2.15/compute/v2.1 |
| 7bfc6b3b67874e95bde847c91f0c6015 | RegionOne | placement | placement | True | public | http://10.0.2.15/placement |
| b46382c857ba4387b7dd5720c17e4436 | RegionOne | cinder | block-storage | True | public | http://10.0.2.15/volume/v3 |
| bdfd731126c448cc98828e44835737f6 | RegionOne | neutron | network | True | public | http://10.0.2.15/networking |
| da60b40260904649a103daf3f04cd1fd | RegionOne | keystone | identity | True | public | http://10.0.2.15/identity |
| ed255c87f4b44dd4a9a75d9e3c8edc6a | RegionOne | nova_legacy | compute_legacy | True | public | http://10.0.2.15/compute/v2/$(project_id)s |
+----------------------------------+-----------+--------------+----------------+---------+-----------+--------------------------------------------+
If successful, look for the Service Type: identity and the Interface: public row. That URL is your controller's main API address.