mirror of
				https://github.com/optim-enterprises-bv/terraform-talos.git
				synced 2025-10-30 17:58:32 +00:00 
			
		
		
		
	Add vultr cloud
This commit is contained in:
		
							
								
								
									
										9
									
								
								system_os/vultr/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								system_os/vultr/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | |||||||
|  |  | ||||||
|  | init: | ||||||
|  | 	packer init -upgrade . | ||||||
|  |  | ||||||
|  | release: | ||||||
|  | 	packer build -only=release.vultr.talos . | ||||||
|  |  | ||||||
|  | develop: | ||||||
|  | 	packer build -only=develop.vultr.talos . | ||||||
							
								
								
									
										19
									
								
								system_os/vultr/variables.pkr.hcl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								system_os/vultr/variables.pkr.hcl
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | |||||||
|  |  | ||||||
|  | variable "vultr_api_key" { | ||||||
|  |   type = string | ||||||
|  |   default = "" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | variable "vultr_region" { | ||||||
|  |   type = string | ||||||
|  |   default = "" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | variable "talos_version" { | ||||||
|  |   type    = string | ||||||
|  |   default = "v0.13.0" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | locals { | ||||||
|  |   image = "https://github.com/talos-systems/talos/releases/download/${var.talos_version}/vultr-amd64.raw.xz" | ||||||
|  | } | ||||||
							
								
								
									
										53
									
								
								system_os/vultr/vultr.pkr.hcl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								system_os/vultr/vultr.pkr.hcl
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,53 @@ | |||||||
|  |  | ||||||
|  | packer { | ||||||
|  |   required_plugins { | ||||||
|  |     vultr = { | ||||||
|  |       version = ">= 2.4.0" | ||||||
|  |       source  = "github.com/vultr/vultr" | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | source "vultr" "talos" { | ||||||
|  |   api_key   = var.vultr_api_key | ||||||
|  |   region_id = var.vultr_region | ||||||
|  |   plan_id   = "vc2-1c-1gb" | ||||||
|  |  | ||||||
|  |   # Arch Linux | ||||||
|  |   iso_id        = "20eceb4f-7b28-466e-aaf4-cff60385c30d" | ||||||
|  |   state_timeout = "10m" | ||||||
|  |   ssh_username  = "root" | ||||||
|  |   ssh_password  = "packer" | ||||||
|  |  | ||||||
|  |   instance_label       = "talos" | ||||||
|  |   snapshot_description = "talos system disk" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | # FIXME | ||||||
|  | build { | ||||||
|  |   name    = "release" | ||||||
|  |   sources = ["source.vultr.talos"] | ||||||
|  |  | ||||||
|  |   provisioner "shell" { | ||||||
|  |     inline = [ | ||||||
|  |       "apt-get install -y wget", | ||||||
|  |       "wget -O /tmp/talos.raw.xz ${local.image}", | ||||||
|  |       "xz -d -c /tmp/talos.raw.xz | dd of=/dev/vda", | ||||||
|  |     ] | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | build { | ||||||
|  |   name    = "develop" | ||||||
|  |   sources = ["source.vultr.talos"] | ||||||
|  |  | ||||||
|  |   provisioner "file" { | ||||||
|  |     source      = "../../../talos-pr/_out/vultr-amd64.raw.xz" | ||||||
|  |     destination = "/tmp/talos.raw.xz" | ||||||
|  |   } | ||||||
|  |   provisioner "shell" { | ||||||
|  |     inline = [ | ||||||
|  |       "xz -d -c /tmp/talos.raw.xz | dd of=/dev/vda", | ||||||
|  |     ] | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										6
									
								
								vultr/auth.tf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								vultr/auth.tf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | |||||||
|  |  | ||||||
|  | provider "vultr" { | ||||||
|  |   api_key     = var.vultr_api_key | ||||||
|  |   rate_limit  = 700 | ||||||
|  |   retry_limit = 3 | ||||||
|  | } | ||||||
							
								
								
									
										17
									
								
								vultr/main.tf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								vultr/main.tf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | |||||||
|  |  | ||||||
|  | resource "vultr_instance" "controlplane" { | ||||||
|  |   plan        = "vc2-1c-1gb" | ||||||
|  |   region      = "ams" | ||||||
|  |   snapshot_id = "0d6f3e7b-62e6-429b-ac53-53108843ee21" | ||||||
|  |   label       = "talos" | ||||||
|  |   tag         = "controlplane" | ||||||
|  |   hostname    = "master-1" | ||||||
|  |  | ||||||
|  |   enable_ipv6         = true | ||||||
|  |   private_network_ids = ["329f9a26-d475-41f0-8e1f-b8cf11814848"] | ||||||
|  |   user_data           = file("talos.yaml") | ||||||
|  |  | ||||||
|  |   backups          = "disabled" | ||||||
|  |   ddos_protection  = false | ||||||
|  |   activation_email = false | ||||||
|  | } | ||||||
							
								
								
									
										5
									
								
								vultr/variables.tf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								vultr/variables.tf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  |  | ||||||
|  | variable "vultr_api_key" { | ||||||
|  |   type      = string | ||||||
|  |   sensitive = true | ||||||
|  | } | ||||||
							
								
								
									
										8
									
								
								vultr/versions.tf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								vultr/versions.tf
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | terraform { | ||||||
|  |   required_providers { | ||||||
|  |     vultr = { | ||||||
|  |       source  = "vultr/vultr" | ||||||
|  |       version = "2.4.1" | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user
	 Serge Logvinov
					Serge Logvinov