diff --git a/week-2/.terraform.lock.hcl b/week-2/.terraform.lock.hcl new file mode 100644 index 0000000..cbdbfec --- /dev/null +++ b/week-2/.terraform.lock.hcl @@ -0,0 +1,23 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/josenk/esxi" { + version = "1.10.3" + hashes = [ + "h1:o78ERC8riDT2nHWCbXECt+S/RKwM98/G5ZojJHRm8fA=", + "zh:208a6a8092fa50d63fe1780447f2c4c3115b1987902a0c986452172c2c35677e", + "zh:3a0755aec960e32dbfbb31be61bba6ee2d11aff0513707e93f4eaebe3d557d93", + "zh:3daef19f36c9438771833dc15ae0eddc95faf9df00f9de9ab143bd031314ce50", + "zh:4cb4ba24aa3975f3928f5f16bc535ce0b18159ede16abaee39f93b3e13c36334", + "zh:56f30098aca0874210c4546530a5bfa5dd49bfad63950f3d9f3623cc6767280b", + "zh:716c62ae2d0cb7c64b5b3328792d7e135c4c0905e399e4b7335b7808508a7027", + "zh:81b0e8fab21088785e51f2d6af518ac31959b104facb2a25b0481d586a6fc692", + "zh:8b415ab7e39ca8e16f923bc73a8af418859faa594d97ed73e3a4aff7a736b08f", + "zh:9072bdd960ef85dc735b82423560b027ebb44790af1e84b122f1014f96acfc91", + "zh:9e6e1c2a7bf93c4705d280cea5b3d6bfb84c4540b92563e64fbc3a20155ef775", + "zh:af14c0e96273470dfb398b1701f575e5ea4963c208a32a4436db5ea0e2f2f385", + "zh:c79e772730ab4ac75c58d368f452c7a76abc738bb3666df0cfb567ac01e32c59", + "zh:d0068e7ca381d4b18df8b0219540733c996dfc69a89673b6bf52e4d69350c09a", + "zh:e188b20664bdcda50c45d071a8d0ba9870368941dac9138cd655f50db4ea15d2", + ] +} diff --git a/week-2/main.tf b/week-2/main.tf new file mode 100644 index 0000000..959a6bc --- /dev/null +++ b/week-2/main.tf @@ -0,0 +1,13 @@ +resource "esxi_guest" "vmtest" { + guest_name = "vmtest" + disk_store = "datastore1" + + memsize = "1024" + numvcpus = "1" + power = "on" + + ovf_source = "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.ova" + network_interfaces { + virtual_network = "VM Network" + } +} \ No newline at end of file diff --git a/week-2/providers.tf b/week-2/providers.tf new file mode 100644 index 0000000..312570f --- /dev/null +++ b/week-2/providers.tf @@ -0,0 +1,15 @@ +terraform { + required_providers { + esxi = { + source = "registry.terraform.io/josenk/esxi" + } + } +} + +provider "esxi" { + esxi_hostname = var.esxi_hostname + esxi_hostport = var.esxi_hostport + esxi_hostssl = var.esxi_hostssl + esxi_username = var.esxi_username + esxi_password = var.esxi_password +} diff --git a/week-2/variables.tf b/week-2/variables.tf new file mode 100644 index 0000000..98d8887 --- /dev/null +++ b/week-2/variables.tf @@ -0,0 +1,22 @@ +variable "esxi_hostname" { + description = "IP address of the ESXi host" +} + +variable "esxi_hostport" { + description = "SSH port of the ESXi host" + default = "22" +} + +variable "esxi_hostssl" { + description = "SSL port of the ESXi host" + default = "443" +} + +variable "esxi_username" { + description = "Username to connect to the ESXi host" +} + +variable "esxi_password" { + description = "Password to connect to the ESXi host" + sensitive = true +}