mirror of
https://github.com/optim-enterprises-bv/terraform-talos.git
synced 2025-10-29 09:32:39 +00:00
Split configs
This commit is contained in:
6
system_os/scaleway/Makefile
Normal file
6
system_os/scaleway/Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
release:
|
||||
packer build -only=release.scaleway.talos .
|
||||
|
||||
develop:
|
||||
packer build -only=develop.scaleway.talos .
|
||||
@@ -8,33 +8,6 @@ packer {
|
||||
}
|
||||
}
|
||||
|
||||
variable "scaleway_project_id" {
|
||||
type = string
|
||||
default = "${env("SCW_DEFAULT_PROJECT_ID")}"
|
||||
}
|
||||
|
||||
variable "scaleway_access_key" {
|
||||
type = string
|
||||
default = "${env("SCW_ACCESS_KEY")}"
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "scaleway_secret_key" {
|
||||
type = string
|
||||
default = "${env("SCW_SECRET_KEY")}"
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "scaleway_zone" {
|
||||
type = string
|
||||
default = "fr-par-2"
|
||||
}
|
||||
|
||||
variable "talos_version" {
|
||||
type = string
|
||||
default = "v0.11.0"
|
||||
}
|
||||
|
||||
source "scaleway" "talos" {
|
||||
project_id = var.scaleway_project_id
|
||||
access_key = var.scaleway_access_key
|
||||
@@ -45,19 +18,35 @@ source "scaleway" "talos" {
|
||||
commercial_type = "DEV1-S"
|
||||
boottype = "rescue"
|
||||
remove_volume = true
|
||||
ssh_username = "root"
|
||||
|
||||
ssh_username = "root"
|
||||
|
||||
snapshot_name = "talos system disk"
|
||||
snapshot_name = "talos system disk"
|
||||
}
|
||||
|
||||
build {
|
||||
name = "release"
|
||||
sources = ["source.scaleway.talos"]
|
||||
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"apt-get install -y wget",
|
||||
"wget -O /tmp/talos.tar.gz https://github.com/talos-systems/talos/releases/download/${var.talos_version}/metal-amd64.tar.gz",
|
||||
"wget -O /tmp/talos.tar.gz ${local.image}",
|
||||
"tar xOzf /tmp/talos.tar.gz | dd of=/dev/vda",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
build {
|
||||
name = "develop"
|
||||
sources = ["source.scaleway.talos"]
|
||||
|
||||
provisioner "file" {
|
||||
source = "../../../talos-pr/_out/scaleway-amd64.tar.gz"
|
||||
destination = "/tmp/talos.tar.gz"
|
||||
}
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"tar xOzf /tmp/talos.tar.gz | dd of=/dev/sda && sync",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
31
system_os/scaleway/variables.pkr.hcl
Normal file
31
system_os/scaleway/variables.pkr.hcl
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
variable "scaleway_project_id" {
|
||||
type = string
|
||||
default = env("SCW_DEFAULT_PROJECT_ID")
|
||||
}
|
||||
|
||||
variable "scaleway_access_key" {
|
||||
type = string
|
||||
default = env("SCW_ACCESS_KEY")
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "scaleway_secret_key" {
|
||||
type = string
|
||||
default = env("SCW_SECRET_KEY")
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "scaleway_zone" {
|
||||
type = string
|
||||
default = "fr-par-2"
|
||||
}
|
||||
|
||||
variable "talos_version" {
|
||||
type = string
|
||||
default = "v0.12.0"
|
||||
}
|
||||
|
||||
locals {
|
||||
image = "https://github.com/talos-systems/talos/releases/download/${var.talos_version}/metal-amd64.tar.gz"
|
||||
}
|
||||
Reference in New Issue
Block a user