Terraform: Instalar en LXC Ubuntu 20.04
Os explicamos, en entrada rápida, como instalar servidor Terraform en un contenedor Proxmox Ubuntu 20.04 LXC
https://developer.hashicorp.com/terraform/install?product_intent=terraform#linux
Instalo dependencias:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
root@TERRAFORM01:~# apt install unzip Reading package lists... Done Building dependency tree... Done Reading state information... Done Suggested packages: zip The following NEW packages will be installed: unzip 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Need to get 175 kB of archives. After this operation, 386 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 unzip amd64 6.0-26ubuntu3.2 [175 kB] Fetched 175 kB in 1s (262 kB/s) Selecting previously unselected package unzip. (Reading database ... 17162 files and directories currently installed.) Preparing to unpack .../unzip_6.0-26ubuntu3.2_amd64.deb ... Unpacking unzip (6.0-26ubuntu3.2) ... Setting up unzip (6.0-26ubuntu3.2) ... |
Descargamos el paquete de la última versión:
1 2 3 4 5 6 7 8 9 10 11 |
root@TERRAFORM01:~# wget https://releases.hashicorp.com/terraform/1.7.4/terraform_1.7.4_linux_amd64.zip --2024-02-23 16:47:42-- https://releases.hashicorp.com/terraform/1.7.4/terraform_1.7.4_linux_amd64.zip Resolving releases.hashicorp.com (releases.hashicorp.com)... 3.160.231.14, 3.160.231.2, 3.160.231.3, ... Connecting to releases.hashicorp.com (releases.hashicorp.com)|3.160.231.14|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 25940915 (25M) [application/zip] Saving to: 'terraform_1.7.4_linux_amd64.zip' terraform_1.7.4_linux_amd64.zi 100%[===================================================>] 24.74M 74.9MB/s in 0.3s 2024-02-03 16:47:43 (74.9 MB/s) - 'terraform_1.7.4_linux_amd64.zip' saved [25940915/25940915] |
Descomprimimos los ficheros:
1 2 3 |
root@TERRAFORM01:~# unzip terraform_1.7.4_linux_amd64.zip Archive: terraform_1.7.4_linux_amd64.zip inflating: terraform |
Movemos los ficheros a la carpeta BIN:
1 |
root@TERRAFORM01:~# mv terraform /bin |
Testeamos la versión:
1 2 3 |
root@TERRAFORM01:~# terraform version Terraform v1.7.4 on linux_amd64 |
Hacemos una llamada de prueba que nos dará los comandos asociados:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
root@TERRAFORM01:~# terraform 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 metadata Metadata related commands 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 Execute integration tests for Terraform modules 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. |
Te ha gustado la entrada SGUENOS EN TWITTER O INVITANOS A UN CAFE?