Friday, November 22, 2024
Google search engine
HomeData Modelling & AIInstall Terraform on CentOS 8 / Rocky Linux 8

Install Terraform on CentOS 8 / Rocky Linux 8

.tdi_3.td-a-rec{text-align:center}.tdi_3 .td-element-style{z-index:-1}.tdi_3.td-a-rec-img{text-align:left}.tdi_3.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_3.td-a-rec-img{text-align:center}}

install terraform fedora 29 fedora 28

Terraform is a cloud-agnostic Infrastructure automation tool created by the awesome HashiCorp Engineers to help you with the infrastructure resource management using code. Terraform allows you build, change, and version infrastructure deployed on popular cloud environments and on premise. This short article will show you how to install terraform on CentOS 8 / Rocky Linux 8 Linux system.

Install Terraform on CentOS 8 / Rocky Linux 8

Before you get started ensure you have a sudo user that will be used to install Terraform on CentOS 8 / Rocky Linux 8 Linux machine. Below few steps should work fine for you.

Step 1: Install yum-utils package

We’ll use yum-utils package that will help in adding HashiCorp repository to the system:

.tdi_2.td-a-rec{text-align:center}.tdi_2 .td-element-style{z-index:-1}.tdi_2.td-a-rec-img{text-align:left}.tdi_2.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_2.td-a-rec-img{text-align:center}}

sudo yum install -y yum-utils

Step 2: Install Terraform on CentOS 8 / Rocky Linux 8

Next we add CentOS YUM repository:

sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

Confirm repository is added and working:

$ sudo dnf repolist
repo id                                                              repo name
appstream                                                            CentOS Stream 8 - AppStream
baseos                                                               CentOS Stream 8 - BaseOS
centos-advanced-virtualization                                       CentOS-8 - Advanced Virtualization
centos-ceph-nautilus                                                 CentOS-8 - Ceph Nautilus
centos-nfv-openvswitch                                               CentOS-8 - NFV OpenvSwitch
centos-openstack-wallaby                                             CentOS-8 - OpenStack wallaby
centos-rabbitmq-38                                                   CentOS-8 - RabbitMQ 38
epel                                                                 Extra Packages for Enterprise Linux 8 - x86_64
epel-modular                                                         Extra Packages for Enterprise Linux Modular 8 - x86_64
extras                                                               CentOS Stream 8 - Extras
hashicorp                                                            Hashicorp Stable - x86_64
powertools                                                           CentOS Stream 8 - PowerTools

If you can see hashicorp from the list proceed to install terraform:

sudo yum -y install terraform

If you wanted to install an older version of Terraform, the HashiCorp Yum repositories contain multiple versions of Terraform:

$ yum --showduplicate list terraform
....
terraform.x86_64                                                                                    1.2.0-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.2.1-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.2.2-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.2.3-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.2.4-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.2.5-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.2.6-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.2.7-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.2.8-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.2.9-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.3.0-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.3.1-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.3.2-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.3.3-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.3.4-1                                                                                       hashicorp
terraform.x86_64                                                                                    1.3.5-1                                                                                       hashicorp

Then select a specific version of Terraform, see example:

sudo dnf install terraform-<version>.x86_64

Step 3: Confirm Terraform Installation on CentOS 8 / Rocky Linux 8

Check the version of Terraform to validate our installation:

$ terraform  version
Terraform v1.3.5
on linux_amd64

You can then refer to some of the guides we have on using Terraform.

Other Learning materials include:

.tdi_4.td-a-rec{text-align:center}.tdi_4 .td-element-style{z-index:-1}.tdi_4.td-a-rec-img{text-align:left}.tdi_4.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_4.td-a-rec-img{text-align:center}}

RELATED ARTICLES

Most Popular

Recent Comments