Thursday, October 14, 2021

How to install Terraform RHEL8

 Install Terraform RHEL8

==============================

  • Login as root user


[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]# dnf install -y dnf-plugins-core

Updating Subscription Management repositories.

Unable to read consumer identity


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


Red Hat Update Infrastructure 3 Client Configuration Server 8 HA                                                                          30 kB/s | 2.1 kB     00:00

Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)                                                                        38 kB/s | 2.8 kB     00:00

Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)                                                                        69 MB/s |  33 MB     00:00

Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)                                                                           32 kB/s | 2.4 kB     00:00

Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)                                                                          101 MB/s |  37 MB     00:00

Red Hat Enterprise Linux 8 for x86_64 - High Availability (RPMs) from RHUI                                                                27 kB/s | 2.4 kB     00:00

Red Hat Enterprise Linux 8 for x86_64 - High Availability (RPMs) from RHUI                                                                11 MB/s | 2.5 MB     00:00

Package dnf-plugins-core-4.0.18-4.el8.noarch is already installed.

Dependencies resolved.

Nothing to do.

Complete!

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#





[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]# dnf config-manager --add-repo https://rpm.releases.hashicorp.com/$release/hashicorp.repo

Updating Subscription Management repositories.

Unable to read consumer identity


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


Adding repo from: https://rpm.releases.hashicorp.com//hashicorp.repo

Status code: 404 for https://rpm.releases.hashicorp.com//hashicorp.repo (IP: 199.232.66.49)

Error: Configuration of repo failed

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#


********** Repo url has issue (Status code: 404 for https://rpm.releases.hashicorp.com//hashicorp.repo (IP: 199.232.66.488))*********** You have to set variable export release=RHEL


[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]# dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

Updating Subscription Management repositories.

Unable to read consumer identity


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


Adding repo from: https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#




[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]# yum install terraform

Updating Subscription Management repositories.

Unable to read consumer identity


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


Last metadata expiration check: 0:00:15 ago on Thu 14 Oct 2021 05:11:42 AM UTC.

Dependencies resolved.

=========================================================================================================================================================================

 Package                                  Architecture                          Version                                   Repository                                Size

=========================================================================================================================================================================

Installing:

 terraform                                x86_64                                1.0.9-1                                   hashicorp                                 25 M


Transaction Summary

=========================================================================================================================================================================

Install  1 Package


Total size: 25 M

Installed size: 76 M

Is this ok [y/N]: y

Downloading Packages:

[SKIPPED] terraform-1.0.9-1.x86_64.rpm: Already downloaded

warning: /var/cache/dnf/hashicorp-164999f2fbadbd87/packages/terraform-1.0.9-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a3219f7b: NOKEY

Hashicorp Stable - x86_64                                                                                                                161 kB/s | 3.1 kB     00:00

Importing GPG key 0xA3219F7B:

 Userid     : "HashiCorp Security (HashiCorp Package Signing) <security+packaging@hashicorp.com>"

 Fingerprint: E8A0 32E0 94D8 EB4E A189 D270 DA41 8C88 A321 9F7B

 From       : https://rpm.releases.hashicorp.com/gpg

Is this ok [y/N]: y

Key imported successfully

Running transaction check

Transaction check succeeded.

Running transaction test

Transaction test succeeded.

Running transaction

  Preparing        :                                                                                                                                                 1/1

  Installing       : terraform-1.0.9-1.x86_64                                                                                                                        1/1

  Verifying        : terraform-1.0.9-1.x86_64                                                                                                                        1/1

Installed products updated.


Installed:

  terraform-1.0.9-1.x86_64


Complete!

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#



[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]# terraform -version

Terraform v1.0.9

on linux_amd64

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#



[root@ip-192.168.1.1 ~]# terraform -help
Usage: terraform [global options] <subcommand> [args]

The available commands for execution are listed below.
The primary workflow commands are given first, followed by
less common or more advanced commands.

Main commands:
  init          Prepare your working directory for other commands
  validate      Check whether the configuration is valid
  plan          Show changes required by the current configuration
  apply         Create or update infrastructure
  destroy       Destroy previously-created infrastructure

All other commands:
  console       Try Terraform expressions at an interactive command prompt
  fmt           Reformat your configuration in the standard style
  force-unlock  Release a stuck lock on the current workspace
  get           Install or upgrade remote Terraform modules
  graph         Generate a Graphviz graph of the steps in an operation
  import        Associate existing infrastructure with a Terraform resource
  login         Obtain and save credentials for a remote host
  logout        Remove locally-stored credentials for a remote host
  output        Show output values from your root module
  providers     Show the providers required for this configuration
  refresh       Update the state to match remote systems
  show          Show the current state or a saved plan
  state         Advanced state management
  taint         Mark a resource instance as not fully functional
  test          Experimental support for module integration testing
  untaint       Remove the 'tainted' state from a resource instance
  version       Show the current Terraform version
  workspace     Workspace management

Global options (use these before the subcommand, if any):
  -chdir=DIR    Switch to a different working directory before executing the
                given subcommand.
  -help         Show this help output, or the help for a specified subcommand.
  -version      An alias for the "version" subcommand.