Ubuntu LinuxにTerraformをインストールする方法を学びたいですか? このチュートリアルでは、LinuxにTerraformをインストールする方法を説明します。

Terraformとは何ですか?

TerraformはHashiCorpによって開発されGO言語で書かれたコードとしてのインフラストラクチャソフトウェアです。

これにより、ユーザーは複数のクラウドプロバイダーに接続してインフラストラクチャ全体を作成または更新できる構成ファイルを作成できます。

例として、管理者はAmazon AWSクラウドでUbuntu Linuxを使用して10台の仮想マシンを自動的に作成し、Azureクラウドに接続してWindowsを実行する仮想マシンを作成する設定ファイルを作成することができます。

Terraformチュートリアル:

このページでは、Terraformに関連したチュートリアルのリストにすばやくアクセスできます。

チュートリアル - Terraformのインストール

Linuxコンソールで、以下のコマンドを使用して必要なソフトウェアをインストールします。

# apt-get update
# apt-get install wget unzip

にアクセスするTerraformダウンロードページ そしてあなたの環境と互換性のあるLinuxバージョンを入手してください。

Terraform Download

Terraformソフトウェアのダウンロードを実行するためにWGETコマンドを使用します。

# mkdir /downloads/terraform -p
# cd /downloads/terraform
# wget https://releases.hashicorp.com/terraform/0.11.13/terraform_0.11.13_linux_amd64.zip

Terraformのダウンロードが完了したら、Terraformインストールパッケージを解凍します。

# unzip terraform_0.11.13_linux_amd64.zip

Archive: terraform_0.11.13_linux_amd64.zip
inflating: terraform

次のコマンドを使用して、UbuntuにTerraformコマンドをインストールします。

# install terraform /usr/local/bin/

以下のコマンドを使用してTerraformのインストールを確認します。

# terraform -version
# terraform

次のように出力されるはずです。

Usage: terraform [-version] [-help] <command> [args]

The available commands for execution are listed below.
The most common, useful commands are shown first, followed by
less common or more advanced commands. If you're just getting
started with Terraform, stick with the common commands. For the
other commands, please read the help and docs before usage.

Common commands:
apply Builds or changes infrastructure
console Interactive console for Terraform interpolations
destroy Destroy Terraform-managed infrastructure
env Workspace management
fmt Rewrites config files to canonical format
get Download and install modules for the configuration
graph Create a visual graph of Terraform resources
import Import existing infrastructure into Terraform
init Initialize a Terraform working directory
output Read an output from a state file
plan Generate and show an execution plan
providers Prints a tree of the providers used in the configuration
push Upload this Terraform module to Atlas to run
refresh Update local state file against real resources
show Inspect Terraform state or plan
taint Manually mark a resource for recreation
untaint Manually unmark a resource as tainted
validate Validates the Terraform files
version Prints the Terraform version
workspace Workspace management

All other commands:

おめでとうございます。 Ubuntu LinuxにTerraformをインストールすることができました。

Terraform対Ansible

どちらもインフラストラクチャをコードとして作成するための優れた製品です。

どちらの製品も、複雑な要件を持つネットワーク環境を展開するために使用できます。

簡単に例証すると、AnsibleはTerraformを使用しながらITソリューションを自動化するツールであり、そのインフラストラクチャをコードソリューションとして使用して完全なインフラストラクチャを作成できます。つまり、複数のクラウドにまたがるネットワーク環境全体を作成できます。 Amazon AWS、Google、Azure、その他はシンプルな設定ファイルを使用しています。

これは、より良い比較へのリンクです。Terraform対Ansible